Skip to Content
author's profile photo Former Member
Former Member

XML Escaping in ABAP via CL_IXML Library?

Hello Partners:

I was going through some work of XML integration of SAP with a third-party. But came across an issue:

The text descriptions we are sending within an XML tag has certain special characters like '&'. But the XML parser is <i>not escaping</i> it. Hence its replacing '&' with '&amp;' in the XML data string. So now I need to understand how can we implement escaping via ABAP for generated XML strings? Can you all please help me to understand which methods to use and how?

It will be much appreciated.

Thanks in advance.

Vivek Singh.

Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • author's profile photo Former Member
    Former Member
    Posted on Nov 16, 2006 at 10:29 AM

    Hi,

    It got escaped in this message I posted! 😊

    The issue is "&" being replaced by "& a m p ;". Please ignore the spaces in the latter, I have put it purposely to avoid the 'amp;' from being escaped when the browser parses this message.

    Thanks.

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Nov 16, 2006 at 10:45 AM
    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Jun 10, 2014 at 10:20 AM

    Hi,

    there is new function in ABAP for escaping characters in different format.

    Predefined escape function in ABAP - escape your HTML / XML / JS content

    Peter

    Add a comment
    10|10000 characters needed characters exceeded

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.