« Return to Thread: Can JAXB Unmarshaller be configured to fail on missing xsi:type-binding?

Re: Can JAXB Unmarshaller be configured to fail on missing xsi:type-binding?

by Glen Mazza :: Rate this Message:

Reply to Author | View in Thread

Perhaps that functionality is intentional, using the base type if a subtype is unknown.  Can you make the base type abstract in your XSD and see if you get error messages that way?  Or is that not something you would wish to do--i.e., sometimes you *do* want the base type instantiated?

Glen

metro-3 wrote:
Hi,

Im using JAXB RI 2.1 to unmarshal my documents, and I'm currently facing the following problem: I have different input XML documents that contain type information via the [i]xsi:type[/i] attribute. The application does not know all possible types used in the input documents. When an unknown type occurs, I want JAXB to report an error. Unfortunately, JAXB just uses the base type and does not report an error.

I've come across Kohsuke's blog where the use of a ValidationEventHandler is recommended. Unfortunately, no error is reported this way either.

Can somebody help out?
[Message sent by forum member 'ck1' (ck1)]

http://forums.java.net/jive/thread.jspa?messageID=354226

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@metro.dev.java.net
For additional commands, e-mail: users-help@metro.dev.java.net

 « Return to Thread: Can JAXB Unmarshaller be configured to fail on missing xsi:type-binding?