我有以下由 Tibco 创建的 xml 消息
<?xml version="1.0" encoding="UTF-8"?>
<SalesInData>
<COMPANYID>AIN2003</COMPANYID>
<ENDDATE>20120825</ENDDATE>
<FILENAME>2-SG4_2244_20120815.xml</FILENAME>
<SalesInRecord>
<ROW_NUM>7</ROW_NUM>
<BUY_QTY>5</BUY_QTY>
<HP_PRODUCT_ID>Apj45685</HP_PRODUCT_ID>
<LOCATION_ID/>
<LOCATION_NAME>XYZ XY</LOCATION_NAME>
<UNIT_BUY_PRICE>999999999</UNIT_BUY_PRICE>
</SalesInRecord>
<STARTDATE>20120819</STARTDATE>
<SUBMITDATE>20120827</SUBMITDATE>
</SalesInData>
<?xml version="1.0" encoding="UTF-8"?>
<SalesInData>
<COMPANYID>AIN2003</COMPANYID>
<ENDDATE>20120825</ENDDATE>
<FILENAME>2-SG4_2244_20120815.xml</FILENAME>
<SalesInRecord>
<ROW_NUM>1</ROW_NUM>
<BUY_QTY>5</BUY_QTY>
<HP_PRODUCT_ID>Apj45678</HP_PRODUCT_ID>
<LOCATION_ID>2-PQL-3401</LOCATION_ID>
<LOCATION_NAME>XYZ el</LOCATION_NAME>
<UNIT_BUY_PRICE>999999999</UNIT_BUY_PRICE>
</SalesInRecord>
<STARTDATE>20120819</STARTDATE>
<SUBMITDATE>20120827</SUBMITDATE>
</SalesInData>
<?xml version="1.0" encoding="UTF-8"?>
<SalesInData>
<COMPANYID>AIN2003</COMPANYID>
<ENDDATE>20120825</ENDDATE>
<FILENAME>2-SG4_2244_20120815.xml</FILENAME>
<SalesInRecord>
<ROW_NUM>1</ROW_NUM>
<BUY_QTY>5</BUY_QTY>
<HP_PRODUCT_ID>Apj45678</HP_PRODUCT_ID>
<LOCATION_ID>2-PQL-3401</LOCATION_ID>
<LOCATION_NAME>XYZ el</LOCATION_NAME>
<UNIT_BUY_PRICE>999999999</UNIT_BUY_PRICE>
</SalesInRecord>
<STARTDATE>20120819</STARTDATE>
<SUBMITDATE>20120827</SUBMITDATE>
</SalesInData>
但预期的输出将是:
<?xml version="1.0" encoding="UTF-8"?>
<SalesInData>
<COMPANYID>AIN2003</COMPANYID>
<ENDDATE>20120825</ENDDATE>
<FILENAME>2-SG4_2244_20120815.xml</FILENAME>
<SalesInRecord>
<ROW_NUM>7</ROW_NUM>
<BUY_QTY>5</BUY_QTY>
<HP_PRODUCT_ID>Apj45685</HP_PRODUCT_ID>
<LOCATION_ID/>
<LOCATION_NAME>XYZ XY</LOCATION_NAME>
<UNIT_BUY_PRICE>999999999</UNIT_BUY_PRICE>
<GOODS_RECIVED_DATE/>
</SalesInRecord>
<SalesInRecord>
<ROW_NUM>1</ROW_NUM>
<BUY_QTY>5</BUY_QTY>
<HP_PRODUCT_ID>Apj45678</HP_PRODUCT_ID>
<LOCATION_ID>2-PQL-3401</LOCATION_ID>
<LOCATION_NAME>XYZ el</LOCATION_NAME>
<UNIT_BUY_PRICE>999999999</UNIT_BUY_PRICE>
<GOODS_RECIVED_DATE/>
</SalesInRecord>
<SalesInRecord>
<ROW_NUM>1</ROW_NUM>
<BUY_QTY>5</BUY_QTY>
<HP_PRODUCT_ID>Apj45678</HP_PRODUCT_ID>
<LOCATION_ID>2-PQL-3401</LOCATION_ID>
<LOCATION_NAME>XYZ el</LOCATION_NAME>
<UNIT_BUY_PRICE>999999999</UNIT_BUY_PRICE>
<GOODS_RECIVED_DATE/>
</SalesInRecord>
<STARTDATE>20120819</STARTDATE>
<SUBMITDATE>20120827</SUBMITDATE>
</SalesInData>
但我想将在 tibco 中创建的这些单独的 xml 记录转换为带有 XSLT 的单个 xml 文档,如上所示。请提供可以执行任务的代码。还有一些其他元素可以为空。