Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- xslt variable strangness
- <a><xsl:copy-of select="(@attrib|exsl:node-set(0))"/></a>
- <b><xsl:copy-of select="(@attrib|exsl:node-set(0))[position()=1]"/></b>
- <x><xsl:copy-of select="(@attrib|exsl:node-set(0))[1]"/></x>
- <xsl:variable name="value" select="@attrib"/>
- <y><xsl:copy-of select="($value|exsl:node-set(0))[1]"/></y>
- <a attrib="1">0</a>
- <b attrib="1"/>
- <x>0</x>
- <y attrib="1"/>
- concat(@attrib,
- substring(0, 2 -not(@attrib))
- )
- <xsl:stylesheet version="1.0"
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
- <xsl:output omit-xml-declaration="yes" indent="yes"/>
- <xsl:template match="x">
- <xsl:value-of select=
- "concat(@attrib,
- substring('0', 2 -not(@attrib))
- )"/>
- ==========
- </xsl:template>
- </xsl:stylesheet>
- <t>
- <x attrib="abc"/>
- <x/>
- </t>
- abc
- ==========
- 0
- ==========
Advertisement
Add Comment
Please, Sign In to add comment