谁能帮我在此处获取 XSLT 逻辑。我已将要求解释为输出中的注释。请找到以下是输出和输入。
输入:
<OutputParameters>
<OUT_SHIPMENT_TBL>
<OUT_SHIPMENT_TBL_ITEM>
<SLevel1>1</SLevel1>
<SLevel1>S</SLevel1>
<DELIVERY_ID>2334356776</DELIVERY_ID>
<ORDER_SHIP_CODE_EXT>3467</ORDER_SHIP_CODE_EXT>
<CUSTOMER_NUMBER>4838</CUSTOMER_NUMBER>
<OEH_POSTAL_CODE xsi:nil="true"/>
<OEH_COUNTRY xsi:nil="true"/>
<ORDER_TBL_TYPE>
<ORDER_TBL_TYPE_ITEM>
<OLevel1>2333</OLevel1>
<OLevel2>344</OLevel2>
<OLevel3>O</OLevel3>
<PURCHASE_ORDER_NUMBER>95678</PURCHASE_ORDER_NUMBER>
<TOTAL_ORDER_GROSSWEIGHT>345</TOTAL_ORDER_GROSSWEIGHT>
<TOTAL_ORDER_SHIPQTY>32</TOTAL_ORDER_SHIPQTY>
<ORDER_LINES_TBL_TYPE>
<ORDER_LINES_TBL_TYPE_ITEM>
<!-- unbounded -->
<ILevel1>2333</ILevel1>
<ILevel2>2333</ILevel2>
<ILevel3>2333</ILevel3>
<PALLET_NUMBER>4546</PALLET_NUMBER>
<CARTON_NUMBER>344235</CARTON_NUMBER>
<WEB_TRANSACTION_ID>346788</WEB_TRANSACTION_ID>
<FREIGHT_TERMS_CODE_INT>243546</FREIGHT_TERMS_CODE_INT>
<VENDOR_NUM>344677</VENDOR_NUM>
<ITEM>50116</ITEM>
<CROSS_REFERENCE_UPC>034138102008</CROSS_REFERENCE_UPC>
</ORDER_LINES_TBL_TYPE_ITEM>
<ORDER_LINES_TBL_TYPE_ITEM>
<ILevel1>2333</ILevel1>
<ILevel2>2333</ILevel2>
<ILevel3>2333</ILevel3>
<PALLET_NUMBER>4546</PALLET_NUMBER>
<CARTON_NUMBER>344235</CARTON_NUMBER>
<WEB_TRANSACTION_ID>346788</WEB_TRANSACTION_ID>
<FREIGHT_TERMS_CODE_INT>243546</FREIGHT_TERMS_CODE_INT>
<VENDOR_NUM>344677</VENDOR_NUM>
<ITEM>50116</ITEM>
<CROSS_REFERENCE_UPC>034138102008</CROSS_REFERENCE_UPC>
</ORDER_LINES_TBL_TYPE_ITEM>
</ORDER_LINES_TBL_TYPE>
</ORDER_TBL_TYPE_ITEM>
<!-- 2 nd Order -->
</ORDER_TBL_TYPE>
</OUT_SHIPMENT_TBL_ITEM>
</OUT_SHIPMENT_TBL>
</OutputParameters>
1)有多个<ORDER_TBL_TYPE_ITEM>
。
2)内部<ORDER_TBL_TYPE_ITEM>
多重<ORDER_LINES_TBL_TYPE_ITEM>
存在。
3)对于每次迭代,我们需要为下面显示的元素分配一个数字序列,如果先前 = 当前忽略 level1、2、3 元素并直接传递 ITEM 值,则条件也存在。
输出:
<OutputParameters>
<OUT_SHIPMENT_TBL>
<OUT_SHIPMENT_TBL_ITEM>
<SLevel1>1</SLevel1>
<SLevel1>S</SLevel1>
<DELIVERY_ID>3335</DELIVERY_ID>
<ORDER_SHIP_CODE_EXT>445</ORDER_SHIP_CODE_EXT>
<CUSTOMER_NUMBER>4838</CUSTOMER_NUMBER>
<OEH_POSTAL_CODE xsi:nil="true"/>
<OEH_COUNTRY xsi:nil="true"/>
<ORDER_TBL_TYPE>
<ORDER_TBL_TYPE_ITEM>
<!-- unbounded -->
<OLevel1>2</OLevel1>
<OLevel2>1</OLevel2>
<OLevel3>O</OLevel3>
<PURCHASE_ORDER_NUMBER>44342</PURCHASE_ORDER_NUMBER>
<!-- assign sequnce number starts from 2 -->
<DELIVERY_ID>133232</DELIVERY_ID>
<!-- hard code value as 1 -->
<TOTAL_ORDER_GROSSWEIGHT>42323C</TOTAL_ORDER_GROSSWEIGHT>
<!-- hard code value as C -->
<TOTAL_ORDER_SHIPQTY>32</TOTAL_ORDER_SHIPQTY>
<ORDER_LINES_TBL_TYPE>
<!-- unbounded -->
<!-- The UniqueID is the temporary variable.PALLET_NUMBER is coming from input.
if PALLET_NUMBER!=NULL then
UniqueID=substring (PALLET_NUMBER, 10)
if PALLET_NUMBER =NULL then
UniqueID=substring (CARTON_NUMBER, 7) -->
<!-- Condition here If previous UniqueID != current UniqueID and PALLET_NUMBER!=NULL then-->IF TRUE
<ORDER_LINES_TBL_TYPE_ITEM>
<ILevel1>3</ILevel1>
<!-- assign sequnce number starts from 3 -->
<ILevel2>2</ILevel2>
<!-- assign sequnce number of <Olevel1> -->
<ILevel3>T</ILevel3>
<!-- hard code value as T-->
<PALLET_NUMBER>45463456788899432445</PALLET_NUMBER>
<CARTON_NUMBER>344235</CARTON_NUMBER>
<WEB_TRANSACTION_ID>3y4</WEB_TRANSACTION_ID>
<FREIGHT_TERMS_CODE_INT>442</FREIGHT_TERMS_CODE_INT>
<VENDOR_NUM>C4466I</VENDOR_NUM>
<ITEM>50116</ITEM>
<CROSS_REFERENCE_UPC>034138102008</CROSS_REFERENCE_UPC>
</ORDER_LINES_TBL_TYPE_ITEM>
<!-- Condition here If previous UniqueID != current UniqueID and PALLET_NUMBER =NULL then-->iF TRUE
<ORDER_LINES_TBL_TYPE_ITEM>
<ILevel1>4</ILevel1>
<!-- assign sequnce number increment -->
<ILevel2>2</ILevel2>
<!-- assign sequnce number of <Olevel1> -->
<ILevel3>P</ILevel3>
<!-- hard code value as T-->
<PALLET_NUMBER></PALLET_NUMBER>
<CARTON_NUMBER>344235</CARTON_NUMBER>
<WEB_TRANSACTION_ID>3y4</WEB_TRANSACTION_ID>
<FREIGHT_TERMS_CODE_INT>442</FREIGHT_TERMS_CODE_INT>
<VENDOR_NUM>C4466I</VENDOR_NUM>
<ITEM>50116</ITEM>
<CROSS_REFERENCE_UPC>034138102008</CROSS_REFERENCE_UPC>
</ORDER_LINES_TBL_TYPE_ITEM>
<ORDER_LINES_TBL_TYPE_ITEM>
<ILevel1>5</ILevel1>
<!-- assign sequnce number increment -->
<ILevel2>4</ILevel2>
<!-- if T Level is true then <ILevel2> of T level
if P Level is true then <ILevel2> of P level
-->
<ILevel3>I</ILevel3>
<!-- hard code value as I-->
<PALLET_NUMBER></PALLET_NUMBER>
<CARTON_NUMBER>344235</CARTON_NUMBER>
<WEB_TRANSACTION_ID>3y4</WEB_TRANSACTION_ID>
<FREIGHT_TERMS_CODE_INT>442</FREIGHT_TERMS_CODE_INT>
<VENDOR_NUM>C4466I</VENDOR_NUM>
<ITEM>50116</ITEM>
<CROSS_REFERENCE_UPC>034138102008</CROSS_REFERENCE_UPC>
</ORDER_LINES_TBL_TYPE_ITEM>
<!-- Condition here If previous UniqueID != current UniqueID and PALLET_NUMBER!=NULL then-->IF FALSE
< NO LOOP HERE FOR T LEVEL>
<!-- Condition here If previous UniqueID != current UniqueID and PALLET_NUMBER =NULL then-->iF TRUE
<ORDER_LINES_TBL_TYPE_ITEM>
<ILevel1>6</ILevel1>
<ILevel2>2</ILevel2>
<ILevel3>P</ILevel3>
<WEB_TRANSACTION_ID>685858</WEB_TRANSACTION_ID>
<FREIGHT_TERMS_CODE_INT>87899</FREIGHT_TERMS_CODE_INT>
<VENDOR_NUM>457482</VENDOR_NUM>
<ITEM>50119</ITEM>
<CROSS_REFERENCE_UPC>034138102008</CROSS_REFERENCE_UPC>
</ORDER_LINES_TBL_TYPE_ITEM>
<ORDER_LINES_TBL_TYPE_ITEM>
<ILevel1>7</ILevel1>
<ILevel2>6</ILevel2>
<ILevel3>I</ILevel3>
<WEB_TRANSACTION_ID>685858</WEB_TRANSACTION_ID>
<FREIGHT_TERMS_CODE_INT>87899</FREIGHT_TERMS_CODE_INT>
<VENDOR_NUM>457482</VENDOR_NUM>
<ITEM>50119</ITEM>
<CROSS_REFERENCE_UPC>034138102008</CROSS_REFERENCE_UPC>
</ORDER_LINES_TBL_TYPE_ITEM>
</ORDER_LINES_TBL_TYPE>
</ORDER_TBL_TYPE_ITEM>
<!-- 2 nd Order -->
</ORDER_TBL_TYPE>
</OUT_SHIPMENT_TBL_ITEM>
</OUT_SHIPMENT_TB
升>