Special characters in XML

Problem:

In an order ticket, among others in the <STOLL:DIRECT_CMD> tag can be used special characters (z.B. das &: <STOLL:DIRECT_CMD>&E2000-</STOLL:DIRECT_CMD>). These special characters regularly lead to an exception when loading the XML file via standard libraries.

Solution:

Like in HTML, in XML the special characters need to be especially formatted.
The five characters &, ', <, >," are entered like in HTML:

&

&amp;

'

&apos;

<

&gt;

>

&lt;

"

&quot;

Example:

&E2000 is to be replaced by &amp;E2000.

The string &amp; (&quot;ampersand&quot;) will be replaced.
M&#252;ller, M&#220;LLER

Output:
The string & ("ampersand") will be replaced.
Müller, MÜLLER

Additional replacement strings for special characters in the respective language:
http://www.thesauruslex.com/typo/eng/enghtml.htm