我試圖使用XSLT從XML文件中刪除重複項。 輸入是這樣的:使用XSLT從XML文件中刪除重複值
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Hide your heart</title>
<artist>Bonnie Tyler</artist>
<country>UK</country>
<company>CBS Records</company>
<price>9.90</price>
<year>1988</year>
</cd>
<cd>
<title>Hide your heart</title>
<artist>Bonnie Tyler</artist>
<country>UK</country>
<company>CBS Records</company>
<price>9.90</price>
<year>1988</year>
</cd>
所需的輸出是:
<catalog>
<cd>
<title>Empire Burlesque</title>
<artist>Bob Dylan</artist>
<country>USA</country>
<company>Columbia</company>
<price>10.90</price>
<year>1985</year>
</cd>
<cd>
<title>Hide your heart</title>
<artist>Bonnie Tyler</artist>
<country>UK</country>
<company>CBS Records</company>
<price>9.90</price>
<year>1988</year>
</cd>
基本上我試圖刪除重複記錄。 我如何完成這項工作?
你使用XSLT 1.0或2.0嗎?如果某些項目(例如'title'和'artist')相同但其他不同(例如'price')會發生什麼? – 2015-03-31 09:55:35
我正在使用XSLT 2.0。 – sidGupta 2015-03-31 10:05:32
現在我不考慮這種情況 – sidGupta 2015-03-31 10:07:35