Quantcast

columnPrefix attribute in association tag causes SAXParserException

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

columnPrefix attribute in association tag causes SAXParserException

max1701
Hi!

I was about to use the "columnPrefix" attribute on the ResultMap's
association tag, but
however when running the code the

org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:
85)

complains, saying

Caused by: org.xml.sax.SAXParseException: Attribute "columnPrefix"
must be declared for element type "association".
        at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:
195)

I'm using mybatis 3.0.6, and the mapper's DOCTYPE I use is just copied
from the samples:

<?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">
...

Thanks in advance for any clues/ideas/help on this issue,

kr max



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: columnPrefix attribute in association tag causes SAXParserException

Eduardo Macarron

You need 3.1 for that

El 16/02/2012 19:25, "max1701" <[hidden email]> escribió:

Hi!

I was about to use the "columnPrefix" attribute on the ResultMap's
association tag, but
however when running the code the

org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:
85)

complains, saying

Caused by: org.xml.sax.SAXParseException: Attribute "columnPrefix"
must be declared for element type "association".
       at
com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:
195)

I'm using mybatis 3.0.6, and the mapper's DOCTYPE I use is just copied
from the samples:

<?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">
...

Thanks in advance for any clues/ideas/help on this issue,

kr max



Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

columnPrefix attribute in association tag causes SAXParserException

Iwao AVE!
In reply to this post by max1701
Hi,

As Eduardo mentioned, 'columnPrefix' is new in 3.1.0 (not yet released).

It would be helpful if you could test it with the snapshot:
http://code.google.com/p/mybatis/downloads/list?can=3&q=snapshot

If you use maven, please see:
http://code.google.com/p/mybatis/wiki/DocMavenTutorial

Regards,
Iwao

2012/2/17 max1701 <<a href="javascript:;" onclick="_e(event, &#39;cvml&#39;, &#39;markus.seebauer@gmail.com&#39;)">markus.seebauer@...>:
> Hi!
>
> I was about to use the "columnPrefix" attribute on the ResultMap's
> association tag, but
> however when running the code the
>
> org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:
> 85)
>
> complains, saying
>
> Caused by: org.xml.sax.SAXParseException: Attribute "columnPrefix"
> must be declared for element type "association".
>        at
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:
> 195)
>
> I'm using mybatis 3.0.6, and the mapper's DOCTYPE I use is just copied
> from the samples:
>
> <?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">
> ...
>
> Thanks in advance for any clues/ideas/help on this issue,
>
> kr max
>
>
>

Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: columnPrefix attribute in association tag causes SAXParserException

Dridi Boukelmoune
Hi,

I think that fixing both issues 465 and 518 would prevent such
confusion.

And with that you would be able to *both*
- test features involving DTD changes
- don't bother users on a specific version

Dridi

http://www.zenika.com/

On Feb 17, 5:59 am, "Iwao AVE!" <[hidden email]> wrote:

> Hi,
>
> As Eduardo mentioned, 'columnPrefix' is new in 3.1.0 (not yet released).
>
> It would be helpful if you could test it with the snapshot:http://code.google.com/p/mybatis/downloads/list?can=3&<http://code.google.com/p/mybatis/downloads/list?can=3&q=snapshot>
> q=snapshot<http://code.google.com/p/mybatis/downloads/list?can=3&q=snapshot>
>
> If you use maven, please see:http://code.google.com/p/mybatis/wiki/DocMavenTutorial
>
> Regards,
> Iwao
>
> 2012/2/17 max1701 <[hidden email] <javascript:;>>:> Hi!
>
> > I was about to use the "columnPrefix" attribute on the ResultMap's
> > association tag, but
> > however when running the code the
>
> org.apache.ibatis.builder.xml.XMLConfigBuilder.parseConfiguration(XMLConfigBuilder.java:> 85)
>
> > complains, saying
>
> > Caused by: org.xml.sax.SAXParseException: Attribute "columnPrefix"
> > must be declared for element type "association".
> >        at
>
> com.sun.org.apache.xerces.internal.util.ErrorHandlerWrapper.createSAXParseException(ErrorHandlerWrapper.java:
>
>
>
>
>
>
>
> > 195)
>
> > I'm using mybatis 3.0.6, and the mapper's DOCTYPE I use is just copied
> > from the samples:
>
> > <?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">
> > ...
>
> > Thanks in advance for any clues/ideas/help on this issue,
>
> > kr max
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: columnPrefix attribute in association tag causes SAXParserException

Eduardo Macarron
Hi Dridi,

I am pretty sure that using more than one DTD will cause more problems
than using just one.

Benefits:
- if you try to use a new feature (column prefix) in an old version
(3.0.6) it will not fail fast or will not give a clear exception.

Cons:
- users (me also) love copy & paste. Now you cannot miskate the DTD
because there is only one but if we go two that will happen.

So I see no clear benefit.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: columnPrefix attribute in association tag causes SAXParserException

Dridi Boukelmoune
Hi Eduardo,

This is the way SpringSource does it for the spring framework
namespaces :
http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/beans/spring-beans-3.1.xsd
http://www.springframework.org/schema/beans/spring-beans-3.0.xsd
http://www.springframework.org/schema/beans/spring-beans-2.5.xsd

The "no-version" URL maps the latest "version" URL and you have the
*choice* not to using version numbers.

It can avoid having xml editors (eclipse for instance) to prompt
elements or attributes unavailable because you're not working with the
latest version of MyBatis. And since MyBatis DTDs are backward
compatible you can omit the version and know it won't break.

I'm a big fan of MyBatis but unfortunately I can't decide on behalf of
the team to upgrade it on an ongoing project and it is a problem if we
can't rely on what our xml editor prompts. And I know of course that
maintaining multiple DTDs for the different versions is additional
workload for the MyBatis team but I think it's worth it on the long
term.

Dridi

http://www.zenika.com/

On Feb 18, 7:13 pm, Eduardo <[hidden email]> wrote:

> Hi Dridi,
>
> I am pretty sure that using more than one DTD will cause more problems
> than using just one.
>
> Benefits:
> - if you try to use a new feature (column prefix) in an old version
> (3.0.6) it will not fail fast or will not give a clear exception.
>
> Cons:
> - users (me also) love copy & paste. Now you cannot miskate the DTD
> because there is only one but if we go two that will happen.
>
> So I see no clear benefit.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate
star

Re: columnPrefix attribute in association tag causes SAXParserException

Eduardo Macarron
> And I know of course that
> maintaining multiple DTDs for the different versions is additional
> workload for the MyBatis team but I think it's worth it on the long
> term.

That's it Dridi, we are not SpringSource :)
Loading...