Escape characters in HTML
<,>, &, And so on have special meanings in HTML. (the first two characters are used for the link sign and escape .). When these three characters are used, their escape sequences should be used, as shown below:
& Amp; or & #38; & and
& Lt; or & #60; <minor sign
& Gt; or & #62;> greater
& Quot; "Double quotation marks
& Nbsp; space
& Copy; Copyright Operator
& Reg
The former is the character escape sequence, and the latter is the numerical escape sequence. Convert the number to the ASCII value corresponding to the character. For example, & lt; font & gt; is displayed as, <font>. If it is written directly, it is considered as a link signature.
Note:
A. There cannot be spaces between characters in the escape sequence;
B. The escape sequence must end;
C. Separate & not considered as the start of escape;
D. case sensitive.
Another character that needs to be escaped is a quotation mark. Its Turn-to-order column is "or """
The character set used by HTML is the iso & 859 Larin-1 character set, which contains many characters that cannot be entered on the standard keyboard. Only escape sequences can be used for these special characters.
XML escape characters
Invalid xml characters must be replaced with corresponding entities.
If you use a character similar to "<" in the XML document, the parser will encounter an error because the parser considers this as the beginning of a new element. So it should not be written as belowCode:
<Message> If salary <1000 then </message>
To avoid this situation, you must convert the character "<" to an object, as shown below:
<Message> If salary <1000 then </message>
The following are five pre-defined entities in the XML document:
& Lt; <Yu no.
& Gt;> greater
& Amp; & and
& Apos; 'single quotes
& Quot; "Double quotation marks
The object must start with the symbol "&" and end with the symbol.
Note: only "<" and "&" characters are strictly forbidden for XML . The rest are legal. It is a good habit to use entities to reduce errors.