Just want to know how to read an attribute of a parent node from a child node in XSLT. code:
<A>
<b attr1="xx">
<c>
</c>
</b>
</A>
XSLT:
<xsl:template match="c">
<xsl:value-of select="attribute of b node">
</xsl:template>
Just want to know how to read an attribute of a parent node from a child node in XSLT. code:
<A>
<b attr1="xx">
<c>
</c>
</b>
</A>
XSLT:
<xsl:template match="c">
<xsl:value-of select="attribute of b node">
</xsl:template>
You can go "up" a level using "..
". So:
<xsl:value-of select="../@attr1"/>