Optional parameters when calling an XSL template

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

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

For example:


  

        
4条回答
  •  误落风尘
    2021-02-18 15:22

    The value in the select part of the param element will be used if you don't pass a parameter.

    You are getting an error because the variable or parameter $baz does not exist yet. It would have to be defined at the top level for it to work in your example, which is not what you wanted anyway.

    Also if you are passing a literal value to a template then you should pass it like this.

      
        fooValue
    

提交回复
热议问题