我有这段代码:
<root>
<profil>
<e a="2" id="1">1</e>
<m a="7" id="2">1</m>
<e a="4" id="3">1</e>
<m a="5" id="4">1</m>
</profil>
<profil>
<e a="5" id="5">1</e>
<m a="3" id="6">1</m>
<e a="4" id="7">1</e>
<m a="4" id="8">1</m>
</profil>
<profil>
<e a="7" id="9">1</e>
<m a="7" id="10">1</m>
<e a="4" id="11">1</e>
<m a="2" id="12">1</m>
</profil>
</root>
我希望循环for-each m具有相同的&#34; a&#34;属性值为e
2- m[id=12]
4- m[id=8]
5- m[id=4]
7- m[id=2]
7- m[id=10]
我试过了,但它不起作用(XSLT 1.0)
<xsl:for-each select="./m/@name=./a/@name">
我用这个
做到了 <xsl:for-each select="./m[@name=./a/@name]">