MyBatis version

3.5.6

Database vendor and version

POSTGRESQL

Test case or example project

Mapper xml example:

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
        PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
        "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="...">

        ...

        <resultMap ...>
                <id property="userName" column="USER_NAME"/>
                <result property="email" column="EMAIL"/>
                <result property="createdBy" column="CREATED_BY"/>
                <result property="createdDate" column="CREATED_DATE"/>
                <result property="lastModifiedBy" column="MODIFIED_BY"/>
                <result property="lastModifiedDate" column="MODIFIED_DATE"/>
                <result property="revisionId" column="REVISION_ID"/>
                <association property="personalName" resultMap="fullNameMap"/>        
                <association property="internalIdPLoginConfiguration" resultMap="internalIdPLoginConfigMap"/>
                <collection property="roles" javaType="java.util.HashSet" ofType="string">
                    <result column="ROLE_NAME"/>
                </collection>
        </resultMap>
</mapper>

Steps to reproduce

You just have a to define an association element within a Mapper XML document.

Expected result

XML parsing should work (it works perfectly fine with MyBatis 3.5.5).

Actual result

My XML editor displays the following errors: Le contenu du type d'élément "resultMap" doit correspondre à "(constructor?,id,result,association,collection,discriminator?)

When running my product, I get the following error from MyBatis:

org.xml.sax.SAXParseException; lineNumber: 69; columnNumber: 17; Le contenu du type d'élément "resultMap" doit correspondre à "(constructor?,id*,result*,association*,collection*,discriminator?)".

Comment From: harawata

Hello @nlenoire ,

It seems unlikely because ...

  • there are many unit tests using <association />
  • there is no DTD change between 3.5.5 and 3.5.6

Check if there is any control character or something in the file.

Comment From: nlenoire

Hi @harawata,

Your're correct. I tried again and it works... Sorry for that. I close the issue.

Thanks