mybatis xml中是sql语句报错: Error creating document instance. Cause: org.xml.sax.SAXParseException: The

因为语句中有一个小于号“<”,在XML中,会被当成一个页面元素来解析,不会处理为mysql的SQL语句的组成部分,修改如下:

1、在xml的sql语句中,不能直接用大于号、小于号要用转义字符

如果用小于号会报错误如下:

org.apache.ibatis.builder.BuilderException: Error creating document instance.  Cause: org.xml.sax.SAXParseException: The content of elements must consist of well-formed character data or markup.

解决办法:

1,转义字符 

        &lt;               <           小于号      
        &gt;      >                 大于号
      &amp;      &            和
      &apos;      ’      单引号
     &quot;      "       双引号

原文地址:https://www.cnblogs.com/wanlige/p/13273383.html