cancel
Showing results for 
Search instead for 
Did you mean: 

XML file - adding attributes of complex data type

Former Member
0 Kudos

Hi

The scenario I have is to create an XML file from an IDoc and send via FTP.

The issue I cannot resolve is the root elemnt (dcsmergedata) of the output needs have the following attributes:

xmlns:xsi = "http://www.w3.org/2001/XMLSchema-instance"

xsi:noNamespaceSchemaLocation="../lib/interface_address.xsd"

XSD sample

<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

<xsd:element name="dcsmergedata" type="dcsmergedatatype"/>

<xsd:complexType name="dcsmergedatatype">

Required XML output

<dcsmergedata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="../lib/interface_address.xsd">

Thanks

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

Thanks for the responses to this

The issue is now resolved - the only way I could get this to work (eventually) was using a simple java mapping, importing as archive and adding to operation mapping.

Thanks

Former Member
0 Kudos

Thanks Baskar

Iu2019ve been trying as youu2019ve suggested, but without success. Iu2019d also prefer to retain the graphical mapping and not use a full xslt mapping

Iu2019ve also tried a simple Java mapping and added as imported archive, which in principle I think should work, but PI appears to strip the u2018xmlnsu2019 and u2018xsiu2019.

If you can expand in more detail your suggestions it would be very helpful

Thanks

Former Member
0 Kudos

Hi Geoff,

Check this forum discussion similar to your issue.

I hope this is helpful.

[Forum Discussion|;

Regards

Praveen K

baskar_gopalakrishnan2
Active Contributor
0 Kudos

Couple of suggestions..

1) Using XMLAnonymizerBean you can anonymize xml elements and attributes by removing namespace and prefixes. But you can add new namespace. Refer this [link|http://help.sap.com/saphelp_nw04/helpdata/en/45/d169186a29570ae10000000a114a6b/content.htm]

2) Customize your root element namespace prefixes using XSLT mapping.