Reputation: 2006
I have the following xml snippet which gets sent to an external web service (note the line feeds):
<xml>
<address>Bob Jones
100 Main St.
Smallville Ohio 39391</address>
</xml>
The web service responds with:
<xml>
<address>Bob Jones 100 Main St. Smallville Ohio 39391</address>
</xml>
In essence the service seems to be encoding line feeds with an html encoding? The only xml encoded values I've seen are:
<
>
"
&
'
or have the following format to represent unicode characters (where u is a digit)
&#uuuu;
The only encoding i've found online that uses
seems to be html encoding. Is this also a valid xml encoding? I thought from the format above it would have to have 4 digits. Online xml checkers are telling me it's valid xml which is surprising me. If this is valid xml, is it bad practice to encode a completely valid xml character (line feed) for seemingly no reason?
Upvotes: 0
Views: 99
Reputation: 100051
is always valid in XML, and a normal parser will simply replace it with the character. &#ANY_16_bit_number; is in fact also valid. You can specify any Unicode character.
Upvotes: 1