我需要使用特定节点(ItemID)消除XML中的重复元素
我的XML看起来如下;
<XML>
<Line>
<SupplierID>Waltons</SupplierID>
<InvoiceID>CAP600795SI</InvoiceID>
<InvoiceDate>20100506</InvoiceDate>
<ItemID>723073</ItemID>
<ColorID>02</ColorID>
<Description>Pentel LR7 Energel Metal Tip Refill 0.7mm</Description>
<MainCategory>WRITING INSTRUMENTS</MainCategory>
<SubCategory>Refill</SubCategory>
<LineNum> 1.0000000</LineNum>
<Qty> 6.0000000</Qty>
<UnitPriceExclTax> 10.0200000</UnitPriceExclTax>
<LineTax> 8.4200000</LineTax>
<LinePriceExclTax> 60.1200000</LinePriceExclTax>
<ColorName>Black</ColorName>
<UOM>EA</UOM>
<Backorder> 0.0000000</Backorder>
<INVENTTRANSID> CAP5637542_060</INVENTTRANSID>
</Line>
<Line>
<SupplierID>Waltons</SupplierID>
<InvoiceID>CAP600795SI</InvoiceID>
<InvoiceDate>20100506</InvoiceDate>
<ItemID>903420</ItemID>
<ColorID />
<Description>STEPHENS JUNIOR Stapler Half Strip KW586</Description>
<MainCategory>OFFICE SUNDRIES</MainCategory>
<SubCategory>Staplers</SubCategory>
<LineNum> 2.0000000</LineNum>
<Qty> 3.0000000</Qty>
<UnitPriceExclTax> 32.2500000</UnitPriceExclTax>
<LineTax> 13.5400000</LineTax>
<LinePriceExclTax> 96.7500000</LinePriceExclTax>
<ColorName />
<UOM>Ea</UOM>
<Backorder> 0.0000000</Backorder>
<INVENTTRANSID> CAP5637547_060</INVENTTRANSID>
</Line>
<Line>
<SupplierID>Waltons</SupplierID>
<InvoiceID>CAP600795SI</InvoiceID>
<InvoiceDate>20100506</InvoiceDate>
<ItemID>867241</ItemID>
<ColorID />
<Description>TRODAT PRINTY S/Inking …Run Code Online (Sandbox Code Playgroud) 我有一个XML文件,其中包含大量不需要/不需要的数据,我想使用XSLT进行清理
这是一小段数据,带有示例空节点
<?xml version="1.0" encoding="utf-8"?>
<Report xsi:schemaLocation="xxx">
<Tablix3>
<Tablix13 Textbox1164="TAX SUMMARY" Textbox10="">
<table26 textbox155="code">
<Detail_Collection>
<Detail textbox198="" TaxText2="" textbox112="0" textbox114="0" textbox200="0" textbox202="0" textbox874="0" />
<Detail textbox198="" TaxText2="" textbox112="0" textbox114="0" textbox200="0" textbox202="0" textbox874="0" />
<Detail textbox198="" TaxText2="" textbox112="0" textbox114="0" textbox200="0" textbox202="0" textbox874="0" />
<Detail textbox198="" TaxText2="" textbox112="0" textbox114="0" textbox200="0" textbox202="0" textbox874="0" />
<Detail textbox198="" TaxText2="" textbox112="0" textbox114="0" textbox200="0" textbox202="0" textbox874="0" />
<Detail textbox198="" TaxText2="" textbox112="0" textbox114="0" textbox200="0" textbox202="0" textbox874="0" />
<Detail textbox198="" TaxText2="" textbox112="0" textbox114="0" textbox200="0" textbox202="0" textbox874="0" />
<Detail textbox198="" …Run Code Online (Sandbox Code Playgroud)