只是想知道如何在XSLT子节点读取父节点的属性。 码:
<A>
<b attr1="xx">
<c>
</c>
</b>
</A>
XSLT:
<xsl:template match="c">
<xsl:value-of select="attribute of b node">
</xsl:template>
只是想知道如何在XSLT子节点读取父节点的属性。 码:
<A>
<b attr1="xx">
<c>
</c>
</b>
</A>
XSLT:
<xsl:template match="c">
<xsl:value-of select="attribute of b node">
</xsl:template>
你可以去“上”使用水平“ ..
”。 所以:
<xsl:value-of select="../@attr1"/>