This week's book giveaway is in the Agile and other Processes forum.
We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes JAXB unmarshal problem with XSD choice element Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Reply Bookmark "JAXB unmarshal problem with XSD choice element" Watch "JAXB unmarshal problem with XSD choice element" New topic
Author

JAXB unmarshal problem with XSD choice element

S Norman
Greenhorn

Joined: Aug 04, 2010
Posts: 1
Hi,
I'm experiencing a problem unmarshalling a <choice> element in an XML document using JAXB RI 2.2.1.

The element is defined as follows (the full XSD is too large to post):



Here is the XML I'm trying to unmarshal:



When I run the document through the unmarshaller, the resulting PatternExpression object contains the PatternOperator and a single Pattern, which happens to be the last one in the sequence.

Does anyone have any suggestions as to why the Pattern objects are not being added to the list?

I would think that the presence of the PatternOperator would allow JAXB to determine what <choice> the element fall into.

FYI, the XML schema is controlled by a 3rd party, so it cannot be modified.
 
I agree. Here's the link: http://zeroturnaround.com/jrebel - it saves me about five hours per week
 
subject: JAXB unmarshal problem with XSD choice element
 
Similar Threads
Multiple url-pattern in filter-mapping OC4j 10.1.3.3 Servlet 2.5
need help in XSD.
XSD: The element may not overlap error.
Castor fail to marshal/un-marshal valid instance of sequence-of-choice schema.
Setter method for element with maxOccurs="unbounded"