Skip to main content

How can I map this schema to Java source correctly?

2 replies [Last post]
kazui
Offline
Joined: 2003-06-11
Points: 0

Hi.

I have an element definition below.
This is one part of a definition of spring-beans.dtd.
When I compiled this definition using Xjc, I got an exception.
[ERROR] Property "Ref" is already defined.
line 500 of file:/E:/jaxb/jaxb-ri-20050622/spring-beans.XSD

It's natural because this element has the reference named ref and the attribute named ref.
I'm able to understand it.
However I'd like to use this definition.
How can I control this mappings?

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
kazui
Offline
Joined: 2003-06-11
Points: 0

I happily could do what I wanted to.
Thank you very much!

sekhar
Offline
Joined: 2003-06-25
Points: 0

Use a jaxb
customization to make the generated property name element ref and attribute ref unique. For e.g.

xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:jaxb="http://java.sun.com/xml/ns/jaxb"
jaxb:version="2.0">








....

will bind to getFoo/setFoo instead of getBar/setBar .