Common sense to write XML code that is often omitted:
Special characters such as "&", "<", ">" are not allowed in the XML entity, or an error occurs when the XML syntax is checked, and if you write an XML file that must contain these characters, it must be written as "&", "<", ">" To write to the file again.
For example, if you use a character like "<" in an XML document, the parser will get an error because the parser will assume that this is the beginning of a new element.
Therefore, you should not write the code as follows:
When reading, the parser automatically converts it back to special characters such as "&", "<", ">", and, normally, only the "<" character and "&" characters are strictly forbidden for XML.
It is important to note that:
A. There can be no spaces between the characters of the escape sequence;
B. The escape sequence must end with ";";
C. Individual & is not considered to be an escape start;
D. Case sensitive.
The following are the required escape characters in XML: [/size]
& (Logic and) &
< (less than) <
> (greater than) >
"(double quotes) "
' (single quotes) ' [/size]
XML Special character processing