I have an XML file from a client that has greater than >
and less than <
signs in it and it fails an XML format check. Is there a way to get around this without asking the client to fix the file?
e.g.
<?xml version="1.0" encoding="UTF-8"?> <note Name="PrintPgmInfo <> VDD"> <to>Tove</to> <from>Jani</from> <heading>Reminder</heading> <body>Don't forget me this weekend!</body> </note>
<= and >= or ≥ and ≤ ? Just use >= and <= .
Just < and > . If you need an 'equals', simply append a = character.
To include special characters inside XML files you must use the numeric character reference instead of that character. The numeric character reference must be UTF-8 because the supported encoding for XML files is defined in the prolog as encoding="UTF-8" and should not be changed.
You may try to use it like this:
< = < > = >
These are known as Character Entity References
You will have to use XML escape characters:
" to " ' to ' < to < > to > & to &
Google escaping characters in XML for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With