cancel
Showing results for 
Search instead for 
Did you mean: 

Possible to insert XML attribute without XSLT?

Former Member
0 Kudos

Hello,

I have a standard output XML structure which is used by many interfaces which contains the following structure:

<NODEA>

<NODEB> Data </NODEB>

</NODEA>

For one single scenario, i need to add an attribute to NODEA to generate the following:

<NODEA someattribute="value">

<NODEB> Data </NODEB>

</NODEA>

However, this attribute is not part of the XSD.. is there a way to insert this via a UDF (or even graphical mapping)? I know it is possible with XSLT, I'm wondering if there is another way.

Cheers

Accepted Solutions (0)

Answers (3)

Answers (3)

Former Member
0 Kudos

you can achieve this by using simple ABAP class which is known as ABAP mapping.

logic is , in SE24, in XI, see the signature of the class

you will get the whole input as single string, just search for <NODEA>

and replace it by another string which has value <NODEA someattribute="value">

Let m eknow if you need more clarification

Former Member
0 Kudos

Hi John

What i understand From your requirement is - Only one of the scenario you want to add attribute. But you are trying to generate the target using Graphical mapping.

Well even with XSLT you can generate target structure only. If the target structure is not having this attribute how that mapping will execute correctly.

I think you should use a seperate XSD for this requirement where you have the attribute in XSD

Thanks

Gaurav

Former Member
0 Kudos

hi jhon,

I think it is possible by using java mapping.

go throgh the following thread.

regards

Sridhar Goli