Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When <result> is converted to <association>, the <association> is not at the end #8

Open
ooizj opened this issue Jan 26, 2021 · 2 comments

Comments

@ooizj
Copy link

ooizj commented Jan 26, 2021

I have a problem:When <result select=""> is converted to <association>, the <association> is not at the end

source

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE sqlMap PUBLIC "-//iBATIS.com//DTD SQL Map 2.0//EN"
    "sql-map-2.dtd">

<sqlMap namespace="ns1">
	
	<resultMap id="rm1" class="a.b.T1">
		<result column="ID" property="id" jdbcType="DECIMAL" />
		<result column="AID" property="aid" select="ns2.s1" />
		<result column="NAME" property="name" jdbcType="VARCHAR2" />
	</resultMap>

</sqlMap>

destination

<?xml version="1.0" encoding="UTF-8"?><!--Converted at: Tue Jan 26 14:03:48 CST 2021-->
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" 
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="ns1">
	
	<resultMap id="rm1" type="a.b.T1">
		<result property="id" column="ID" jdbcType="DECIMAL"/>
		<association property="aid" select="ns2.s1" column="AID"/>
		<result property="name" column="NAME" jdbcType="VARCHAR2"/>
	</resultMap>

</mapper>

output

PS C:\download\ibatis2mybatis-master> ant
Buildfile: build.xml

migrateToMyBatis3:
     [xslt] Transforming into C:\download\ibatis2mybatis-master\destination
     [xslt] Processing C:\download\ibatis2mybatis-master\source\TestMap.xml to C:\download\ibatis2mybatis-master\destination\TestMap.xml
     [xslt] Loading stylesheet C:\download\ibatis2mybatis-master\migrate.xslt
     [xslt] Warning: org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://javax.xml.XMLConstants/property/accessExternalDTD' is not recognized.
     [xslt] Warning: org.apache.xerces.jaxp.SAXParserImpl$JAXPSAXParser: Property 'http://www.oracle.com/xml/jaxp/properties/entityExpansionLimit' is not recognized.
[xmlvalidate] C:\download\ibatis2mybatis-master\destination\TestMap.xml:10:14: The content of element type "resultMap" must match "(constructor?,id*,result*,association*,collection*,discriminator?)".

BUILD FAILED
C:\download\ibatis2mybatis-master\build.xml:46: C:\download\ibatis2mybatis-master\destination\TestMap.xml is not a valid XML document.
@harawata
Copy link
Member

Thank you for the report, @ooizj !

This repo is not actively maintained, unfortunately.
You may have to move the <association /> manually after the conversion.

If someone knows how to fix this, please send us a PR.

@SuryaT1999
Copy link

Hi,
I run the previous code i received Error like this

 [xslt] Loading stylesheet C:\download\ibatis2mybatis\migrate.xslt
 [xslt] : Error! Use of the extension function 'http://xml.apache.org/xslt/java:new' is not allowed when the secure processing 
 feature is set to true.
 [xslt] Failed to process null.

BUILD FAILED
C:\download\batis2mybatis\build.xml:25: javax.xml.transform.TransformerException: java.lang.RuntimeException: Use of the extension function 'http://xml.apache.org/xslt/java:new' is not allowed when the secure processing feature is set to true.

Total time: 1 second.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants