Application Development and Automation 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: 
Read only

XML to ABAP

Former Member
0 Likes
853

Hello sdn

I have a problem. I have an xml file and i want to get data from this file into an abap field (using xslt). I have tried the sxsltdemo1 and made my own version of this program. This works fine, but my realworld xml file contains some xml-schemas. This creates the problem i think. I'm not able to get data from the xml file using xslt (which is how i nedd to do it). Is there any documentation how to extract data from an xml which contains schemas.

The problem is that i need to get an xml-field which is encoded in base64 into a abap field.

Hello sdn

I have a problem. I have an xml file and i want to get data from this file into an abap field (using xslt). I have tried the sxsltdemo1 and made my own version of this program. This works fine, but my realworld xml file contains some xml-schemas. This creates the problem i think. I'm not able to get data from the xml file using xslt (which is how i nedd to do it). Is there any documentation how to extract data from an xml which contains schemas.

The problem is that i need to get an xml-field which is encoded in base64 into a abap field.

5 REPLIES 5
Read only

Former Member
0 Likes
772

the problem is also that the xml contains namespaces

Read only

0 Likes
772

Did you try ABAP class <b>cl_xml_document</b>? It has <b>parse</b> method which should convert your source document into a hierarchical representation. I tried it in the opposite way, from ABAP to XML.

Read only

0 Likes
772

Hi Sergei,

Is it possible to to create an XML file on the Application Server through an ABAP Program? do you have a sample?

thanks,

dattis

Read only

0 Likes
772

You can definetely do this with <b>cl_xml_document</b>.

Suppose you have already created proper structure of the document in an instance of <b>cl_xml_document</b>. Then you can render an xml strucuture into arbitrary internal table with <b>render2table</b> method and then transfer the table to any file on Application Server with old good statements OPEN DATASET and TRANSFER.

Read only

Former Member
0 Likes
772

Hello,

you need to parse your XML File into a Document Object

Model (DOM) using the iXML Parser.

Then you can use the DOM API to copy selected nodes

to a separate DOM (the nodes you are interested).

This new DOM you can transform into an ABAP data structure

using the statement

call transformation id...

Class CL_APL_ECATT_XML has a method for parsing

an XML (XML_TO_DOM).

Regards,

Marc