Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Need help getting rid of those <ASX:ABAP> tags from the generated XML file!

Former Member
0 Kudos

I was able to transfer xml data from abap internal tables to a string.

Here is the content of the string:

-


<?xml version="1.0" encoding="iso-8859-1"?>

<asx:abap version="1.0" xmlns:asx="http://www.sap.com/abapxml">

<asx:values>

<DATA>

<item>

<UOM1 />

<UOM2>L</UOM2>

<GL_PR_SEG />

<RECORDMODE>A</RECORDMODE>

</item>

</DATA>

</asx:values>

</asx:abap>

-


Now my goal is to strip out a couple of tags out of that string directly using xslt.

Do you know of any way i could take out the <asx:abap> and <asx:values> tags using an xslt program. I'd like to be able to strip them out directly from the string itself.

1 ACCEPTED SOLUTION

Former Member
0 Kudos

Aja, where do you suggest i find the function "replace all occurences of"? Is it from abap or xslt?

Keep in mind that the xml code that I want to edit is in a string. Although it is possible to dump the code in a file and edit it, i don't have that option here!

Are you suggesting that I use XSLT or ABAP to get rid of these <asx> tags? A couple of code fragments would help.

6 REPLIES 6

athavanraja
Active Contributor
0 Kudos

Hi,

its the XML namespace, go thru the following link to understand about namespace.

http://www.rpbourret.com/xml/NamespacesFAQ.htm#q1_1

if you really want to remove it,(understanding the implications) you can just use

<b>replace all occurrences of</b> to replace the unwanted text to space.

Regards

Raja

0 Kudos

Thanx Raja, i will try it now and get back to you!

Former Member
0 Kudos

Aja, where do you suggest i find the function "replace all occurences of"? Is it from abap or xslt?

Keep in mind that the xml code that I want to edit is in a string. Although it is possible to dump the code in a file and edit it, i don't have that option here!

Are you suggesting that I use XSLT or ABAP to get rid of these <asx> tags? A couple of code fragments would help.

0 Kudos

its not function. its within abap.

within your abap program, the xml code is in a string for example xml_string .

use

replace all occurrences of '<ASX:ABAP>' in xml_string with '' .

replace all occurrences of '</ASX:ABAP>' in xml_string with '' .

replace all occurrences of '<ASX:VALUES>' in xml_string with '' .

replace all occurrences of '</ASX:VALUES>' in xml_string with '' .

Hope this solves your issue.

If your question is answered, reward the helpful answers with points and close the thread.

Regards

Raja

Former Member
0 Kudos

Thanks Raja!!

Let me know if the points have been rewarded!!!

0 Kudos

Hi,

Good to hear that i was able to help you. and thanks for the points. yes i got them

Regards

Raja