xsl: how to use parameter inside “match”?

后端 未结 4 1149
南旧
南旧 2020-12-11 08:01

My xsl has a parameter


I want to use it inside match



        
4条回答
  •  感情败类
    2020-12-11 08:35

    The XSLT 1.0 W3C Specification forbids referencing variables/parameters inside a match pattern.:

    "It is an error for the value of the match attribute to contain a VariableReference"

    There is no such limitation in XSLT 2.0, so use XSLT 2.0.

    If due to unsurmountable reasons using XSLT2.0 isn't possible, put the complete body of the instruction inside an where the test in conjunction with the match pattern is equivalent to the XSLT 2.0 match pattern that contains the variable/parameter reference(s).

    In a more complicated case where you have more than one template matching the same kind of node but with different predicates that reference variables/parameters, then a wrapping will need to be used instead of a wrapping .

提交回复
热议问题