12-09-2009 12:47 PM
Hi,
I am using CALL TRANSFORMATION with a simple transformation:
<?sap.transform simple?>
<tt:transform xmlns:tt="http://www.sap.com/transformation-templates">
<tt:root name="ROOT"/>
<tt:template>
<bopf_bo>
<tt:copy ref="ROOT"/>
</bopf_bo>
</tt:template>
</tt:transform>
to transform a dynamic deep internal table into XML.
My first issue is that the ouput of the call transformation is not a formatted string with tabs and lines e.g.
<bopf_bo>
<item>
<name>
abc
</name>
...
</item>
</bobf_bo>
I could not find an option of the CALL TRANSFORMATION to format the output in a readable form so you can read it
even in a simple text editor, not only loaded in a browser.
My second issue is that I would like to nicely display this in e.g. as HTML. Is there a way to automatically genarate
XSL stylesheet the same way the XML was generated out of the internal table?
Does anyone know how these can be solved?
Thanks,
Ivaylo.
12-09-2009 3:06 PM
Hello. I don´t understand your problem. If you save this xml as a xml file and open it for example with MS Internet Explorer, the internal tool for viewing xml is called and displays the xml formatted and let you open/ close nodes etc. Otto
12-09-2009 3:13 PM
Yes, opening with IE works as you describe. But I would like to see it formatted, when I open it with simple editor e.g. Notepad. Of course it will not be active content as in IE but I would like to see it like nested elements on new lines and not just one string line. And second in the IE I would like to have an automatically generated XSL stylsheet to display it not as XML but as a HTML table.
Edited by: Ivaylo Lilovsky on Dec 9, 2009 4:14 PM
08-18-2011 8:06 PM
08-18-2011 9:57 PM
Hi,
DATA l_xml TYPE string.
data lo_xml type ref to cl_xml_document.
l_xml = '<?xml version="1.0"?><data>hello world</data>'.
create object lo_xml.
call method lo_xml->parse_string
exporting
stream = l_xml.
call method lo_xml->display.
Sandra