The first type is to escape the characters
in the Mybatis configuration Xml file. Strictly speaking, The only characters "<" and "&" are illegal in XML. Ellipses, quotation marks, and greater-than signs are legal, but it's good practice to replace them with entity quotes.
"<" will generate an error because the parser will interpret this character as the beginning of a new element.
"&" will also generate an error because the parser will interpret this character as the beginning of the character entity .
Solution, use Xmlescape character instead:
Representative symbols | Introduction | |
---|---|---|
< | is less than | |
> | is greater than | ##& |
and | ' | |
single quotes | " | |
Double quotes |
:
The CDATA part cannot containString"]]>". Nested CDATA sections are also not allowed. The "]]>" marking the end of the CDATA section cannot contain spaces or line breaks.
The above is the detailed content of Detailed introduction to Mybatis's method of handling greater than and less than signs in Xml. For more information, please follow other related articles on the PHP Chinese website!