users@jaxb.java.net

Re: 1.0-beta: getContent() usage??

From: Irv Thomae <ithomae_at_ists.dartmouth.edu>
Date: Wed, 04 Dec 2002 17:33:41 -0500

Joe Fialli wrote:

> Irv Thomae wrote:
>
>> ....
>> When the Schema Compiler processes the following schema fragment
>>
>> <xsd:complexType name="routerReport" mixed="true">
>
>
> Mixed content has to be supported as a list of Elements and text.
> See Section 5.9.3 and 5.9.4 in JAXB specification on how to use
> the list and WHY it is a necessary binding.
>
> Drop mixed="true" and you would get property accessors as expected.
> With mixed="true" you are manipulating marked up text, not something
> that binds well to a data structure.
>
> -Joe

Thank you!!!! That makes a _big_ difference (as you knew it would, of
course.)

Again in the spirit of making the Users' Guide clearer, I had added the
"mixed" modifier after discovering that a schema fragment in which an
attribute preceded one or more element's either within or preceding a
sequence would not compile. Adding "mixed" appeared to solve the
problem - (except, of course, that it was introducing another - but I
didn't know that yet.)

    Although I do see now that in the SampleApplication schema, any
attribute(s) if present _follow_ sequences of elements, an explicit
comment that this somewhat counterintuitive ordering is necessary would
be very helpful.

    One more question, if you don't mind:
   In a complete data file, there could be thousands of "as" elements.
 I've just discovered "the hard way" that inserting a large value of
maxOccurs , i.e.
      <xsd:element name="AS" type="ASreport" maxOccurs="10000"/>
crashes the schema compiler with a StackOverflow. Is there an
approved notation for "essentially unbounded" that won't send the schema
compiler off a recursion cliff?

 Thanks again,
    Irv Thomae