This code is supposed to print the full path to all elements and attributes in the data.
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="3.0" expand-text="yes">
<xsl:output method="text"/>
<xsl:template match="text()"/>
<xsl:template match="*">
{ancestor-or-self::*/concat(node-name(),'/')}<xsl:apply-templates select="@*|*"/>
</xsl:template>
<xsl:template match="@*">{'@' || node-name() || ','}</xsl:template>
</xsl:stylesheet>
So with this input
<a:b xmlns:a="ans" xmlns:c="cns">
<c:x/>
</a:b>
I expect
{ans}b
{ans}b/ {cns}x
precise spacing is immaterial.
I am getting output as if I had used the name() function instead of node-name i.e
a:b
a:b / c:x
There is probably a work-around by concatenating local-name and namespace-uri but I would like to know why what is posted isn't doing what I hoped it would.