Skip to Content
0

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

Dec 14, 2017 at 10:29 AM

37

avatar image

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

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

5 Answers

Best Answer
Evgeniy Kolmakov Dec 14, 2017 at 11:48 AM
0

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.

Show 1 Share
10 |10000 characters needed characters left 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.

0
Raghuraman S Dec 14, 2017 at 10:36 AM
0

Hello Samir,

Can you share the sample XML?.

you wish to read value for attribute named XMLNS?

Share
10 |10000 characters needed characters left characters exceeded
Samir Lambe Dec 14, 2017 at 10:53 AM
0

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)
Share
10 |10000 characters needed characters left characters exceeded
ambuj mishra Dec 14, 2017 at 12:39 PM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hi Ambuj,

Seems you have analyzed query wrongly, pi itself not reflecting data type attribute with name 'xmlns' in run time or test environment. Physical data it wont carry in source attribute with name 'xmlns'.

Regards,

Samir.

0

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.

0
Andrzej Filusz Dec 14, 2017 at 11:13 AM
0

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

Show 2 Share
10 |10000 characters needed characters left characters exceeded

Hello Andrzej Filusz,

Please check attached screen hot of SRC tab.

At run time neither data is passing into attribute 'xmlns' nor reflecting field itself in target/ test.

Regards,

Samir.test2.jpg

test2.jpg (28.4 kB)
0

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

0