Document directory
The following are five pre-defined entities in the XML document:
| & Lt; |
< |
Yu no. |
| & Gt; |
> |
Yu no. |
| & Amp; |
& |
And |
| & Apos; |
' |
Single quotes |
| & Quot; |
" |
Double quotation marks |
The object must start with the symbol "&" and end with the symbol.
Note: Only the "<" and "&" characters are strictly forbidden for XML. The rest are legal. It is a good habit to use entities to reduce errors.
CDATA parts
All content in CDATA is ignored by the parser.
If the text contains many "<" characters and "&" characters-like program code, it is best to put them in the CDATA component.
A CDATA part starts with "<! [CDATA ["Mark start, end with"]> "mark:
<script> <![CDATA[ function matchwo(a,b) { if (a < b && a < 0) then { return 1 } else { return 0 } } ]]> </script> |
In the previous example, all texts between CDATA components are ignored by the parser.
CDATA considerations:
CDATA components cannot be nested ). If the CDATA part contains the character "]>" or "<! [CDATA [", which may cause errors.
Note that there is no space or line break between the string "]>.