Skip to main content

xs:group and data binding

2 replies [Last post]
niessner
Offline
Joined: 2012-11-14

I have been googling this for an hour or more and not finding what I really want. I have a bit of schema that can be boiled down to something like this:


abstract_class
some attributes

Then a couple of couple of complex types that inherit from abstract_class. All that is just fine when I look a the generated code from XJC. However, I then have



some list of abstract_class extensions


extension of abstract_class
Consuming secured WCF service from Java client Jax ws authentication

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
mlejter
Offline
Joined: 2007-05-02

I think it will be easier if you send out a sample schema that has the problem
that you face ...

Moises

On Nov 14, 2012, at 10:49 PM, forums@java.net wrote:

> I have been googling this for an hour or more and not finding what I really
> want. I have a bit of schema that can be boiled down to something like this:
> abstract_class some attributes Then a couple of couple of complex types that
> inherit from abstract_class. All that is just fine when I look a the
> generated code from XJC. However, I then have some list of abstract_class
> extensions extension of abstract_class When I look at the class generated for
> ContainerType, the information about ContainerElement is completely missing.
> Why? How do I get JAXB to bind the ContanerElement and then put one into
> ContainerType? Just for reference, I tried pyxbgen and got the same results.
>

niessner
Offline
Joined: 2012-11-14

Thank you very much for help or your attempt to give me some help.

Turns out that abstract_class is an xs:complexType with both abstract and mixed set to true. All of the concrete extensions of abstract_class also have mixed set to true. If I simply removed the mixed attribute from abstract_class (essentially setting it to false) all works as it should. The xs:group works just fine.