Xml
HTML
the escape character in
HTML, >,& and so on have special meaning, (the first two characters used for link check,& for escape), cannot be used directly. When you use these three characters, you should use their escape sequences, as follows:
& or &
&
And
< or <
<
Less than sign
> or >
>
Greater-than sign
"
"
Double quotes
Space
©
©
Copyright symbol
®
®
Register character
The former is a character escape sequence, and the latter is a numeric escape sequence. The number is converted to the ASCII value of the character. For example & lt; Font > shown as, if directly written as is considered a link to sign.
What needs to be stated is:
A. there should be no spaces between the characters of the escape sequence;
B. the escape sequence must end with ";" ;
c. a separate & is not considered to be an escape start;
d. Case sensitive.
Another character that needs to be escaped is the quotation mark, whose escape sequence is "" "or" "
The character set used by HTML is the ISO &859 Larin-1 character set, which has many characters that cannot be entered on a standard keyboard. Only escape sequences can be used for these special characters.
XML Escape Character
An illegal XML character must be replaced with the corresponding entity.
If you use a character similar to "<" in an XML document, the parser will get an error because the parser will think that this is the beginning of a new element. So you should not write the code as follows:
If salary < 1000 Then
To avoid this, you must convert the character "<" to an entity, as follows:
If salary < 1000 Then
Here are five entities that are predefined in an XML document:
<
<
Less than sign
>
>
Greater-than sign
&
&
And
'
'
Single quotation mark
"
"
Double quotes
The entity must begin with the symbol "&" with the symbol ";" End.
Note: Only the "<" and "&" characters are strictly prohibited for XML. The rest is legal, and in order to reduce errors, using entities is a good habit.