遍历显示的属性值一样,何故?
<?xml version= "1.0 " encoding= "gb2312 "?>
<?xml-stylesheet type= "text/xsl " href= "a.xsl "?>
<a>
<b val= "1 "/>
<b val= "2 "/>
<b val= "3 "/>
</a>
XSL文件如下:
<xsl:for-each select= "//b ">
<xsl:value-of select= "//@val "/>
</xsl:for-each>
[解决办法]
<xsl:template match= "a ">
<xsl:for-each select= "b ">
<xsl:value-of select= "@val " /> <br />
</xsl:for-each>
</xsl:template>
[解决办法]
<xsl:template match= "//b ">
<xsl:value-of select= "@val " /> <br />
</xsl:template>