Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Dear Friends,
Can someone help me translating one xml to another xml using xslt.
Please see below input xml which has name and valueAsString elements where it determine to go what level of element.
Input xml:
<?xml version="1.0" encoding="UTF-8"?> <outputMessage> <offers> <attributes> <name>type</name> <valueAsString>pkg</valueAsString> </attributes> <attributes> <name>name</name> <valueAsString>First package</valueAsString> </attributes> <attributes> <name>id</name> <valueAsString>P1</valueAsString> </attributes> </offers> <offers> <attributes> <name>type</name> <valueAsString>grp</valueAsString> </attributes> <attributes> <name>parent_id</name> <valueAsString>P1</valueAsString> </attributes> <attributes> <name>id</name> <valueAsString>G1</valueAsString> </attributes> </offers> <offers> <attributes> <name>type</name> <valueAsString>ofr</valueAsString> <valueDataType>string</valueDataType> </attributes> <attributes> <name>parent_id</name> <valueAsString>P1</valueAsString> </attributes> <attributes> <name>id</name> <valueAsString>OFR1</valueAsString> </attributes> </offers> <offers> <attributes> <name>type</name> <valueAsString>ofr</valueAsString> </attributes> <attributes> <name>parent_id</name> <valueAsString>G1</valueAsString> </attributes> <attributes> <name>id</name> <valueAsString>OFR2</valueAsString> </attributes> </offers> <offers> <attributes> <name>type</name> <valueAsString>ofr</valueAsString> </attributes> <attributes> <name>parent_id</name> <valueAsString>null</valueAsString> </attributes> <attributes> <name>id</name> <valueAsString>OFR3</valueAsString> </attributes> </offers> </outputMessage>
Output xml:
<?xml version="1.0" encoding="UTF-8"?> <offers> <offer> <id>OFR3</id> </offer> <package ID="P1"> <groups> <group ID="G1"> <offer> <ID>OFR2</ID> </offer> </group> </groups> <offer>OFR1</offer> </package> </offers>
Thanks in Advance, Raju
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
xml to xml using xslt
Dear Friends,
Can someone help me translating one xml to another xml using xslt.
Please see below input xml which has name and valueAsString elements where it determine to go what level of element.
Input xml:
Output xml:
Thanks in Advance, Raju
is working on a reply...