-1
<Invoice>
<Invoice_Details>
<Consolidated_Invoice_ID>1</Consolidated_Invoice_ID>
<Line>1</Line>
<Gross_Invoice_Amount>1110</Gross_Invoice_Amount>
</Invoice_Details>
<Invoice_Details>
<Consolidated_Invoice_ID>1</Consolidated_Invoice_ID>
<Line>2</Line>
<Gross_Invoice_Amount>1110</Gross_Invoice_Amount>
</Invoice_Details>
<Invoice_Details>
<Consolidated_Invoice_ID>2</Consolidated_Invoice_ID>
<Line>1</Line>
<Gross_Invoice_Amount>2220</Gross_Invoice_Amount>
</Invoice_Details>
<Invoice_Details>
<Consolidated_Invoice_ID>2</Consolidated_Invoice_ID>
<Line>2</Line>
<Gross_Invoice_Amount>2220</Gross_Invoice_Amount>
</Invoice_Details>
</Invoice>
我想要的格式的輸出中:
<Invoice>
<Invoice_Details>
<Consolidated_Invoice_ID>1</Consolidated_Invoice_ID>
<Line>1</Line>
<Gross_Invoice_Amount>1110</Gross_Invoice_Amount>
</Invoice_Details>
<Invoice_Details>
<Consolidated_Invoice_ID>1</Consolidated_Invoice_ID>
<Line>2</Line>
<Gross_Invoice_Amount>1110</Gross_Invoice_Amount>
</Invoice_Details>
<Invoice_Details>
<Consolidated_Invoice_ID>1</Consolidated_Invoice_ID>
<Line>3</Line>
<Gross_Invoice_Amount>22220</Gross_Invoice_Amount>
</Invoice_Details>
<Invoice_Details>
<Consolidated_Invoice_ID>2</Consolidated_Invoice_ID>
<Line>1</Line>
<Gross_Invoice_Amount>2220</Gross_Invoice_Amount>
</Invoice_Details>
<Invoice_Details>
<Consolidated_Invoice_ID>2</Consolidated_Invoice_ID>
<Line>2</Line>
<Gross_Invoice_Amount>2220</Gross_Invoice_Amount>
</Invoice_Details>
<Invoice_Details>
<Consolidated_Invoice_ID>2</Consolidated_Invoice_ID>
<Line>3</Line>
<Gross_Invoice_Amount>4440</Gross_Invoice_Amount>
</Invoice_Details>
</Invoice>
發票ID的值和行值將被創建爲添加所有相同ID的總數的新元素。
條件: 只有在任何可用的id中至少有一個毛重值時,才需要毛值。如果沒有毛值可用,則不需要。
請加任何XSLT的1.0標籤或XSLT的2.0並詳細說明您正在使用的XSLT版本。 – Madeyedexter
Soa接受這兩個版本..感謝 –