Variable for xslt template tag match attribute

Is it possible to set a variable name for the value of the match attribute in the xslt template tag. Any help?

+4
source share
1 answer

I'm not quite sure what you want to achieve, but here is an example:

<!-- a variable --> <xsl:variable name="x" select="//some/path"/> <!-- a template to match all elements with the name of the variable --> <xsl:template match="*[name(.)=$x]"> Yes! <xsl:value-of select="."/> </xsl:template> 
+1
source

Source: https://habr.com/ru/post/1344076/


All Articles