users@jaxb.java.net

Error Unmarshalling Extended Complex Type

From: Brian Hannan <bhannan_at_mac.com>
Date: Mon, 07 Apr 2003 00:17:20 -0700

I get an interesting bug using JAXB which I hope will be fixed next
release.

1. Define a complex type using complexType. In that complex require no
elements. That is every element is declared along the lines of
minOccurs="0".

2. Extend defined complex type with another complex type. In the
extended complex type define any number of elements.

3. Define element using extended complex from step 2.

4. Create an XML document with element defined in step 3.

5. Unmarshall document from step 4.

If none of the optional elements from parent complex type are there in
the XML document you have in 4, you'll get an error. However, this
should not be the case since all the elements defined in step 1 have
minOccurs="0".

Is this known about? Any workarounds?

--
Brian Hannan
Chief Admiral of Uncle Jam's Navy
"One nation under a groove, gettin' down just for the FUNK of it."