我需要 XSLT 1.0 中的帮助将以下 Source XML 转换为 Result XML。对 XSLT 不是很熟悉,同时也在这个论坛上搜索有用的帖子。谢谢你的帮助。
源 XML:
<BomCollection>
<BomAssyV>
<sender>Oracle</sender>
<messageid>ABCD1234EFG</messageid>
<bomid>1234</bomid>
<partid>4567</partid>
<loc>DEL</loc>
<country>IND</country>
<cost>30</cost>
<linenumber>1</linenumber>
<componentpartid>CID1</componentpartid>
<componenttype>CTYPE</componenttype>
<quantityperpart>2</quantityperpart>
</BomAssyV>
<BomAssyV>
<sender>Oracle</sender>
<messageid>ABCD1234EFG</messageid>
<bomid>1234</bomid>
<partid>4567</partid>
<loc>DEL</loc>
<country>IND</country>
<cost>30</cost>
<linenumber>2</linenumber>
<componentpartid>CID2</componentpartid>
<componenttype>CTYPE</componenttype>
<quantityperpart>30</quantityperpart>
</BomAssyV>
<BomAssyV>
<sender>Oracle</sender>
<messageid>ABCD1236EFG</messageid>
<bomid>4321</bomid>
<partid>8901</partid>
<loc>MUM</loc>
<country>IND</country>
<cost>45000</cost>
<linenumber>1</linenumber>
<componentpartid>PID3</componentpartid>
<componenttype>PTYPE</componenttype>
<quantityperpart28></quantityperpart28>
</BomAssyV>
</BomCollection>
结果 XML:
<request>
<sender>Oracle</sender>
<messageId>ABCD1234EFG</messageId>
<header>
<bomid>1234</bomid>
<partId>4567</partId>
<loc>DEL</loc>
<country>IND</country>
<cost>30</cost>
<line>
<lineNumber>1</lineNumber>
<componentPartId>CID1</componentPartId>
<componentType>CTYPE</componentType>
<quantityPerPart>2</quantityPerPart>
</line>
<line>
<lineNumber>2</lineNumber>
<componentPartId>CID2</componentPartId>
<componentType>CTYPE</componentType>
<quantityPerPart>30</quantityPerPart>
</line>
</header>
<header>
<bomid>4321</bomid>
<partId>8901</partId>
<loc>MUM</loc>
<country>IND</country>
<cost>45000</cost>
<line>
<lineNumber>1</lineNumber>
<componentPartId>PID3</componentPartId>
<componentType>PTYPE</componentType>
<quantityPerPart></quantityPerPart>
</line>
</header>
</request>