cancel
Showing results for 
Search instead for 
Did you mean: 

XML Manipulation - iXML Class

Former Member
0 Kudos

I am using the iXML class in ABAP to create an xMII compatible XML document (ROWSETS / ROWSET / ROW). The document is returned as a standard output string back to xMII. The question is how can I assign the result to an XML variable? Depending on the assignment option that I pick, I get one of the following two results:

1: <?xml version="1.0" encoding="UTF-8"?><XML>&lt;?xml version="1.0" encoding="utf-8"?&gt; .....

Note that this is an XML document wrapped and encoded in an XML document.

2: <?xml version="1.0" encoding="UTF-8"?>

If I take the string and write it to a text file then load the file using the XML loader it works fine. Any way I can achieve this results without an intermediate file???

Accepted Solutions (0)

Answers (5)

Answers (5)

Former Member
0 Kudos

Figured it out. I had to REMOVE the XML in the XML variable prior to assigning the XML in my string.

Former Member
0 Kudos

Figured it out. I had to REMOVE the XML in the XML variable prior to assigning the XML in my string.

Former Member
0 Kudos

you may need to use the xmlencode( String ) and/or xmldecode( String ) functions of the link editor. I know we have to to this when we pass the contents of an xml document as a String and convert it back into and xml type.

Former Member
0 Kudos

Hi, Christian. Your situation is a bit different, if I recall - you're actually passing the XML document as a String parameter inside a web service, aren't you?

Former Member
0 Kudos

Sounds like the StringToXmlConverter is just what you need. Just be sure you have 11.5 SR3 installed + latest hotfixes.

- Rick

Former Member
0 Kudos

Rick -

We look to be up to date per your previous posting. Not sure I am explaining my problem well. Let me describe a way to reproduce it:

1. In BLS, create an xMII xml document with a couple columns and a couple rows.

2. Save the xml to a file via the XML Saver Action.

3. Load the file via the text loader. Now you have an xml document contained in a string variable.

4. Assign the string variable to an XML variable. (This is my problem).

What I want to end up with is an XML identical to the one generated in step 1.

Former Member
0 Kudos

Step 4 should work fine withe StringToXmlConverter (not the StringListToXmlConverter).

- Rick

Former Member
0 Kudos

Assuming that you are running 11.5 SR3, use the StringToXmlConverter action (note that this action did not work properly prior to SR3).

Former Member
0 Kudos

Rick -

This encodes and encapsulates my existing XML document inside of an xMII XML document. The contents of my string is an XML document. I want to assign it to a property of type XML without any type of conversion.