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: 

convert XML document (IF_IXML_DOCUMENT) to String: Leading blanks get lost

0 Kudos

Hi ,

for the conversion from IF_IXML_DOCUMENT to String I am using

/SLOAP/CL_CHART_UTIL- CONVERT_XMLOBJ_TO_STRING

The method has just some simple statements:

*** convert XML document to String

  lo_ixml = cl_ixml=>create( ).

*   Creating a stream factory
  lo_streamfactory = lo_ixml->create_stream_factory( ).
*   Connect sting variable to stream factory
  lo_ostream = lo_streamfactory->create_ostream_cstring( string = lv_xml ).

*   Rendering the document
  lo_renderer = lo_ixml->create_renderer( ostream  = lo_ostream
                                          document = io_xml_document ).

  lv_check = lo_renderer->render( ).

But I found that leading Blanks get lost.

I got a String which contains

<str name="value">                         100.00000</str>

This String will be converted to a IF_IXML_DOCUMENT to extract some values

After that the IF_IXML_DOCUMENT get re-converted with the methods mentioned above.

The the String looks:

<str name="value">100.00000</str>

Has anybody an idea ? Is this an error in SAP's standard methods? Or do I use the wrong methods?

Thanks, regards

Mario

0 REPLIES 0