是否有任何方法使用XSLT 1.0將xml1轉換爲xml2?合併沒有直接引用的元素
XML1:
<E1BPBUSISM008_ITEM_OUT>
<ITEM_NUMBER>010</ITEM_NUMBER>
</E1BPBUSISM008_ITEM_OUT>
<E1BPBUSISM008_ITEM_OUT>
<ITEM_NUMBER>020</ITEM_NUMBER>
</E1BPBUSISM008_ITEM_OUT>
<E1BPBUSISM008_ITEM_AD_OUT>
<ITEM_NUMBER>010</ITEM_NUMBER>
<AD_SPEC_NO>000001</AD_SPEC_NO>
</E1BPBUSISM008_ITEM_AD_OUT>
<E1BPBUSISM008_ITEM_AD_OUT>
<ITEM_NUMBER>020</ITEM_NUMBER>
<AD_SPEC_NO>000002</AD_SPEC_NO>
</E1BPBUSISM008_ITEM_AD_OUT>
<E1BPBUSISM008_AD_SPEC_AD_OU>
<AD_SPEC_NO>000001</AD_SPEC_NO>
<KEYWORD>key1</KEYWORD>
</E1BPBUSISM008_AD_SPEC_AD_OU>
<E1BPBUSISM008_AD_SPEC_AD_OU>
<AD_SPEC_NO>000002</AD_SPEC_NO>
<KEYWORD>key2</KEYWORD>
</E1BPBUSISM008_AD_SPEC_AD_OU>
到XML2:
<Ad>
<ad-number>010</ad-number>
<keyword>key1</keyword>
</Ad>
<Ad>
<ad-number>020</ad-number>
<keyword>key2</keyword>
</Ad>
如果沒有辦法進行直接轉化,這將有助於合併XML1成類似:
<E1BPBUSISM008_ITEM_OUT>
<ITEM_NUMBER>010</ITEM_NUMBER>
<KEYWORD>key1</KEYWORD>
</E1BPBUSISM008_ITEM_OUT>
<E1BPBUSISM008_ITEM_OUT>
<ITEM_NUMBER>020</ITEM_NUMBER>
<KEYWORD>key2</KEYWORD>
</E1BPBUSISM008_ITEM_OUT>
亞歷山大Stzhalkovski:您目前接受的答案與提交的最佳答案 - @TimC所提供的答案不一樣好。 –