As I understand from the documents, an XSLT function document () with an empty string as a parameter should read the current XSLT document. But the following code does not work:
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<state>test2</state>
<xsl:template match="/">
test1
<xsl:value-of select="document('')/*/state"/>
</xsl:template>
</xsl:stylesheet>
When I apply this XSLT to some XML (for example, for example), I only have "test1" as the output. Why line
<xsl:value-of select="document('')/*/state"/>
doesn't print "test2"?
source
share