Skip to Content

Attribute name with xmlns not allowing in SAP pi/po 7.4

Hello Experts,

In my scenario, i have created data type in which i have to read the value from attribute 'xmlns' name and the same needs to be populated in target attribute 'xmlns'.

Pi not able to hold data into source attribute 'xmlns' as attribute 'xmlns' not generating in test tab. Instead of xmlns if other name given then it holds value into it, but not for xmlns.

Same thing i tried through XSD as well but attribute with name 'xmlns' xsd tag not populating.

Please suggest a way for achieving the same.

Regards,

Samir

Add a comment
10|10000 characters needed characters exceeded

Related questions

5 Answers

  • Best Answer
    Posted on Dec 14, 2017 at 11:48 AM

    Hi Samir!

    In XML attribute named "xmlns" is attended to introduce default namespace. You shouldn't use it as custom attribute in your structure.

    Let me ask: why do you want to use it in your data type?

    Regards, Evgeniy.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 14, 2017 at 10:36 AM

    Hello Samir,

    Can you share the sample XML?.

    you wish to read value for attribute named XMLNS?

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 14, 2017 at 10:53 AM

    Hi,

    Please find attached screen shots, were definition tab reflects xmlns attribute but in the test tab wont reflects attribute.

    if we change it to other name instead of xmlns, it gets reflect in test tab as well.

    Regards,

    Samir


    test.jpg (29.2 kB)
    definition.jpg (34.9 kB)
    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 14, 2017 at 11:13 AM

    Hi Samir,

    As I understand, your problem is related to the fact that your attribute: "xmlns" is a special one - it defines an XML namespace. Why do you want to set/change the namespace in your mapping? If it's really necessary then you can do it in a java mapping, for example.

    I'm curious how your test message looks like. Could you please press "Src" button and attach the screenshot?

    Regards,

    Andrzej

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Dec 14, 2017 at 12:39 PM

    Hi,

    Please read what is the significance of XMLNS first.

    https://www.w3schools.com/xml/xml_namespaces.asp

    This is what you are trying to achieve "xmlns:xmlns". You are trying to wrap/designate your xml element within "xmlns" itself. This is not allowed in XML world. Its a reserved keyword.

    You can also relate it like, you are trying to use a primitive data type name itself in java (int, float etc.) for your variable name.

    int int=8; //Wrong, not allowed, your compiler is confused

    int a=8; //Correct, allowed, compiler is happy

    Hope you would have understood the issue here.

    Thanks,

    Ambuj

    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.