Optional parameters when calling an XSL template

前端 未结 4 1481
广开言路
广开言路 2021-02-18 14:36

Is there way to call an XSL template with optional parameters?

For example:


  

        
4条回答
  •  南方客
    南方客 (楼主)
    2021-02-18 15:03

    You're using the xsl:param syntax wrong.

    Do this instead:

    
      
      
      
      ...possibly more params...
    
    

    Param takes the value of the parameter passed using the xsl:with-param that matches the name of the xsl:param statement. If none is provided it takes the value of the select attribute full XPath.

    More details can be found on W3School's entry on param.

提交回复
热议问题