Skip to content

解析MyBatis XML文件报错 <otherwise> data is invalid #1193

Closed
actiontech/mybatis-mapper-2-sql
#10
@sjjian

Description

@sjjian

SQLe Version

sqle main

Describe the bug

解析MyBatis XML文件报错 data is invalid,当otherwise标签内有等其他嵌套标签时。测试用例:

<mapper namespace="Test">
    <select id="testChoose">
        SELECT
        *
        FROM
        fruits
        <where>
            <choose>
                <when test="name != null">
                    AND name = #{name}
                </when>
                <otherwise>
                    <if test="price != null and price !=''">
                        AND price = ${price}
                    </if>
                </otherwise>
            </choose>
        </where>
    </select>
</mapper>

Expected behavior

期望正常解析

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingverifiedthe issue all pr is verified

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions