0
我對XSL轉型非常陌生這裏是問題。如果我有這樣的XML文件:使用XSLT刪除XML中未定義級別的重複條目
<root>
<node id="a">
<section id="a_1">
<item id="0">
<attributes>
<color>Red</color>
</attributes>
</item>
</section>
<section id="a_2">
<item id="0">
<attributes>
<color>Red</color>
</attributes>
</item>
</section>
</node>
<node id="b">
<section id="b_1">
<user id="b_1a">
<attribute>
<name>John</name>
</attribute>
</user>
<user id="b_1b">
<attribute></attribute>
</user>
<user id="b_1a">
<attribute>
<name>John</name>
</attribute>
</user>
</section>
</node>
</root>
,我想輸出是這樣的:
<root>
<node id="a">
<section id="a_1">
<item id="0">
<attributes>
<color>Red</color>
</attributes>
</item>
</section>
<section id="a_2">
<item id="0">
<attributes>
<color>Red</color>
</attributes>
</item>
</section>
</node>
<node id="b">
<section id="b_1">
<user id="b_1a">
<attribute>
<name>John</name>
</attribute>
</user>
<user id="b_1b">
<attribute></attribute>
</user>
</section>
</node>
</root>
而問題是我不知道的水平有多深能去,但只要它在同一層次上,有重複的,我們刪除它。 這是可能做到的。我一直試圖解決這一整天,並沒有得到任何線索。 任何幫助將不勝感激。
歡呼聲, 約翰
非常感謝!它現在有效 – John 2012-04-17 03:25:30