开发者

variable for match attribute of xslt template tag

开发者 https://www.devze.com 2023-02-17 04:41 出处:网络
Is it possible to set a variable name for the match attribute value in xslt template tag. Any开发者_如何学Go help? I\'m not entirely sure about what you want to achieve, but here is an example:

Is it possible to set a variable name for the match attribute value in xslt template tag. Any开发者_如何学Go help?


I'm not entirely sure about 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>
0

精彩评论

暂无评论...
验证码 换一张
取 消