Skip to Content
0
Jul 31, 2015 at 11:54 PM

Reverse XML Special Character Escaping

4129 Views

Hi All,

I'm looking for a way to reverse XML Special Character escaping using ABAP. Essentially what I'm looking for is the reverse of the ESCAPE function. I have strings of data that contain escaped XML snippets, like below. I need to parse out the escaped special characters and write the result out to a file. The trivial way would just be to do a "REPLACE" of the 5 basic escaped characters, but I know that the standards are more complicated than that (for example, you can use " in place of " and characters in CDATA must not be escaped). I'd like my solution to be as completely standards-compliant as possible. Does anyone have any advice?

Thanks,

Alex

Example Escaped Snippet:

<?xml version="1.0" encoding="utf-8"?>

Desired Result:

<?xml version="1.0" encoding="utf-8"?>