1
我期待將XML1轉換爲XML2(基本上添加其他名稱空間& )。XML消息的XSLT轉換 - 初學者
我被告知這可以通過XSLT完成。這是可以使用XSLT實現的嗎?它有多簡單(或複雜)?
XML1
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE Update_WCS_OrderStatus SYSTEM "Update_WCS_OrderStatus_20.dtd" >
<Update_WCS_OrderStatus>
<ControlArea>
<Verb value="Constant">test</Verb>
<Noun value="Constant">Constant</Noun>
<Credentials>
<LogonId>a</LogonId>
<Password>b</Password>
</Credentials>
</ControlArea>
<DataArea>
<OrderStatus>
<OrderStatusHeader>
<OrderNumber/>
</OrderStatusHeader>
<OrderStatusItem>
<ItemNumber/>
</OrderStatusItem>
</OrderStatus>
</DataArea>
</Update_WCS_OrderStatus>'
XML2
'<?xml version="1.0" encoding="UTF-8"?>
<ns0:Messages xmlns:ns0="http://sap.com/xi/XI/SplitAndMerge">
<ns0:Message1>
<!DOCTYPE Update_WCS_OrderStatus SYSTEM "Update_WCS_OrderStatus_20.dtd" >
<Update_WCS_OrderStatus>
<ControlArea>
<Verb value="">Constant</Verb>
<Noun value="">Constant</Noun>
<Credentials>
<LogonId>test</LogonId>
<Password>test</Password>
</Credentials>
</ControlArea>
<DataArea>
<OrderStatus>
<OrderStatusHeader>
<OrderNumber/>
</OrderStatusHeader>
<OrderStatusItem>
<ItemNumber/>
</OrderStatusItem>
</OrderStatus>
</DataArea>
</Update_WCS_OrderStatus>
</ns0:Message1>
</ns0:Messages>