users@jaxb.java.net

mixed="true" getContent()

From: Simon Bates <simon.bates_at_utoronto.ca>
Date: Mon, 24 Nov 2003 12:19:47 -0500

Dear all,

I have a query about JAXB and elements defined as containing mixed
content. I was hoping someone could help me.

I am working with a schema that has many of its elements defined with
mixed="true". I believe the schema was defined this way for flexibility
and that in practise mixed content is actually never used.

The classes that JAXB generates for elements with mixed content contains
a single method, getContent(). I understand why this is the case and it
is, of course, the right thing to do. However, in my case I am never
interested in the text that might appear between elements.

For convenience it would be great if JAXB could generate classes that
have getters and setters rather than getContent().

I know it is a lot to expect but I was wondering if it is at all
possible to have JAXB generate classes as if elements were not mixed,
with getters and setters, and at validation consider text where mixed
elements are defined to be ok. I would prefer not to change the schema
just in case I had to unmarshal a document that did have mixed content.
I would be happy to simply ignore the text in this case.

Thanks very much for your time,
Simon


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe_at_jaxb.dev.java.net
For additional commands, e-mail: users-help_at_jaxb.dev.java.net