Sending Special Characters
There are some special characters that are used by the XML syntax. If used within elements and attributes they needed to be escaped or encapsulated. There a 2 ways to handle these.
attention
Not all special characters are allowed. Please refer to the XML schema files for more information.
Replacing characters
The preferred method is to replace these by the corresponding XML notation:
Character | XML notation |
---|---|
< |
< |
> |
> |
& |
& |
" |
" |
' |
' |
Most frameworks do this replacement automatically.
Example for article-description “Black & White”:
<item article-number="1">
quantity="2"
unit-price-gross="17.40"
tax-rate="19">Black & white</item>
Using CDATA
As an alternative you can encapsulate the element with <![CDATA[ ... ]]>
.
Example for article-description “Black & White”
<item article-number="1">
quantity="2"
unit-price-gross="17.40"
tax-rate="19"><![CDATA[Black & White]]></item>
attention
Note: This only works within elements, not within attributes.
danger
Don't use CDATA for credentials.
Handling of umlauts
Umlauts have to be sent as they are (ä, ö, ...). Escaping for these characters is not recommended.
If an escaping is necessary for some reason, please use UTF-8 escaping.
Examples
Character | Decimal | Hexadecimal |
---|---|---|
ü |
ü |
ü |
Ü |
Ü |
Ü |
ö |
ö |
ö |
Ö |
Ö |
Ö |
... | ... | ... |
danger
Please do not use HTML escaping (ü
for ü
). HTML escaping will cause type mismatches and encoding errors.