mybatis(mybatis-plus)映射文件(XML文件)中特殊字符转义
·
引用地址:https://blog.csdn.net/qq_37284798/article/details/132617245
一 前言
XML 文件在解析时会将五种特殊字符进行转义,当不希望语法被转义时,就需要进行特别处理,参考HTML字符转义规范Myabtis 中五个特殊字符
原始符号 符号含义
> 大于
< 小于
& and
" 英文双引号
’ 英文单引号
二 方法一:<![CDATA[ ]]>
<select id="select" resultMap="user">
select * from user where age
< ![CDATA[ > ]] > 18
</select>
1
2
3
4
三 方法二:使用转义字符
<select id="select" resultMap="user">
select * from user where age > 18
</select>
1
2
3
原始符号 转义字符
> >
< <
& &
" "
’ &apos
更多推荐




所有评论(0)