Forum Discussion
deepak_shaw
4 years agoContributor
Hi @marjan.karafiloski ,
Thanks for your reply.
The output is coming like:
<?xml version='1.0' encoding='UTF-8'?>
<DocumentRoot>
<Document>
<Metadata>
<asMap>
<global>
<doc_id>ae803607-d70c-11ec-9afc-6bf587c0d9c9</doc_id>
</global>
</asMap>
<id>ae803607-d70c-11ec-9afc-6bf587c0d9c9</id>
</Metadata>
<Data>
<xml><?xml version="1.0" encoding="UTF-8"?><Products><Product><ProductCode>A001</ProductCode><ProductName>DellLaptop</ProductName><Price>$400</Price><Country>US</Country></Product><Product><ProductCode>A001</ProductCode><ProductName>DellLaptop</ProductName><Price>$500</Price><Country>AU</Country></Product><Product><ProductCode>A001</ProductCode><ProductName>DellLaptop</ProductName><Price>$550</Price><Country>EU</Country></Product></Products></xml>
<original>
<products>
<ProductCode>A001</ProductCode>
<ProductName>DellLaptop</ProductName>
<Price>$400</Price>
<Country>US</Country>
</products>
<products>
<ProductCode>A001</ProductCode>
<ProductName>DellLaptop</ProductName>
<Price>$500</Price>
<Country>AU</Country>
</products>
<products>
<ProductCode>A001</ProductCode>
<ProductName>DellLaptop</ProductName>
<Price>$550</Price>
<Country>EU</Country>
</products>
</original>
</Data>
</Document>
</DocumentRoot>
With some additional tags, how to remove them?
One more thing How I can introduce namespaces in output xml with the approch you have suggested. Sample xml with output is like:
<?xml version="1.0" encoding="UTF-8"?>
<ProductCode xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"
xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2">
<cbc:ProductName>
<cac:CostLocation>
<cbc:country>US</cbc:country>
<cbc:Cost>$400</cbc:Cost>
</cac:CostLocation>
<cac:CostLocation>
<cbc:country>AU</cbc:country>
<cbc:Cost>$500</cbc:Cost>
</cac:CostLocation>
<cac:CostLocation>
<cbc:country>EU</cbc:country>
<cbc:Cost>$550</cbc:Cost>
</cac:CostLocation>
</cbc:ProductName>
</cbc:ProductCode>
Looking forward for your suggestions.
Regards,
Deepak Shaw
robin
4 years agoFormer Employee
The Snap has a DocumentRoot
value in the “Root Element” setting