Skip to Content

how to add ns0 to the root namesapce

Hi

Target SAP system is expecting n0: at the namepsace as shown below.

But the file from customer is coming without n0: I have a file--pi-->proxy scenario.(No mapping)

I went through lot of blogs, and tried XMLAnonymizer Bean on file adapter module. It is adding ns0: for all the elements. I just need to root node as shown in the screenshot. If add bean on SOAP adapter it has no effect.

I have tried XSLT Mapping from but it is simply adding another namespace tag at the root.

I have no control on source and target and need to change only in SAP PI/PO System. Is there a way to make this work in SAP XI/PI ?

Thanks

Ravindra

root tag.PNG (9.4 kB)
Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Posted on Jun 23, 2016 at 12:31 AM

    Hi Ravindra,

    Please check the below blog for XMLAnonymizer Bean configuration

    Replace Namespace in PI by XMLAnonymizer Bean in communication channel-Example step by step

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jun 23, 2016 at 11:30 AM

    Hi Ravindra,

    I have tried XSLT Mapping from UDF to add xml namespace tag but it is simply adding another namespace tag at the root.

    If you have the SAME namespace in in source and target, then you just write down the root as you want to have it and put between opening and closing tag the xsl expression xsl:copy-of select="./*". So you select all child nodes of the root.

    If you have different source and target namespace you need to map each field.

    Best would be if you post your source, your wished target and your xsl.

    /Udo

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 25, 2016 at 04:00 PM

    Hi Ravinda,

    try this:

    Create a own XSD from org. xml message with:

    Free Online XSD/XML Schema Generator From XML - FreeFormatter.com

    Import this as the new XSD and make with this a message mapping to your needed target format. In this case no XSLT or modul bean is needed.

    Quick and dirty is also possible to make the message mapping with a xml message (source format - is an option to use an xml). I prefer solution one, but have also sceanrios which running well with the other solution.

    Regards Thomas

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.