What Characters Do I Need to Escape in Xml Documents?
What Characters Must Be Escaped in Xml Documents, or Where Could I Find Such a List? 6 10 Answers If You Use an Appropriate Class or Library, They Will Do the...
What characters must be escaped in XML documents, or where could I find such a list?
10 Answers
If you use an appropriate class or library, they will do the escaping for you. Many XML issues are caused by string concatenation.
XML escape characters
There are only five:
" "
' '
< <
> >
& &
Escaping characters depends on where the special character is used.
The examples can be validated at the W3C Markup Validation Service.
Must Read
Text
The safe way is to escape all five characters in text. However, the three characters ", ' and > needn't be escaped in text:
<?xml version="1.0"?>
<valid>"'></valid>