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 comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Best Answer
    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 comment
    10|10000 characters needed characters exceeded

    • Hi Evgeniy Kolmakov,

      Actually i need to read two different or dynamic xml namespaces from single structure (2 XSD are concatined into single data type) and populate into target, source & target structure contains attribute name as 'xmlns'.

      Regards,

      Samir.

  • 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 comment
    10|10000 characters needed characters exceeded

  • 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

    Add comment
    10|10000 characters needed characters exceeded

  • 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 comment
    10|10000 characters needed characters exceeded

    • It reflects. Click on the SRC button in test tab. You will get the picture.That was my point. you can not use xmlns for your custom attribute name, choose a different name. PI won't recognize it. Just like you can not define a variable name with int, float etc.

  • 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 comment
    10|10000 characters needed characters exceeded

    • Hi Samir,

      Thank you.

      As I wrote before, if you really need to put some value to this attribute you can do it using a java mapping for example. But to be quite honest, this issue smells like a bad design to me.

      Regards,

      Andrzej