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 html using xslt

Former Member
0 Likes
2,152

Hello    

I want to convert xml file to html with using xslt file.

in c# I can do easily with below code.

How can i do in abap.

var xslt = new XslCompiledTransform();

xslt.Load(@"C:\2013000000007.xslt");

xslt.Transform(@"C:\2013000000007.xml", @"output.html");

Thank you.  

best regards.

1 REPLY 1
Read only

hendrik_brandes
Contributor
0 Likes
1,149

Hello Osman,

you can do this with the CALL TRANSFORMATION command.

Example:

DATA:

  l_xml  TYPE string,

  l_html TYPE string.

l_xml = get_xml( ).

CALL TRANSFORMATION zxml2html

  SOURCE XML l_xml

  RESULT XML l_html.

Even if there is a XML output, you can specify, that the XSL-processor will do a HTML-output.

Create your XSL-Transformation with the transaction XSLT_TOOL.

You will have to respect some SAP specials, but I would try to import your existing XSLT and try to activate.

Kind regards,

Hendrik