JAXBErrorHandler#warning [message #1231843] |
Wed, 15 January 2014 14:42 |
Pëtr Andreev Messages: 3 Registered: January 2014 |
Junior Member |
|
|
Hi there, i`m evaluation a MOXy org.eclipse.persistence:org.eclipse.persistence.moxy:jar:2.6.0-SNAPSHOT
and implemented custom javax.xml.bind.ValidationEventHandler as described in Using a ValidationEventHandler. Works fine, but i discovered, that while validating against a schema the JAXBErrorHandler#warning#L51 notifies the EventHandler with a severity ERROR instead of WARNING if some attribute is OXM-unmapped (from UnmarshalRecordImpl.startUnmappedElement). The problem is that i don`t want to OXM-map every element in the XML-data, but just validate against schema. The XML-data are perfectly valid, i validated them using 3rd party tools. It`s kind of confusing, since the data is valid, the OXM is valid, the unmarshalling works, but the validation fails. Should i open a JIRA issue for that? Thanks for the good job on MOXy!
|
|
|
Re: JAXBErrorHandler#warning [message #1232365 is a reply to message #1231843] |
Thu, 16 January 2014 19:25 |
|
A JAXB implementation will always throw a ValidationEvent with severity ERROR when an unmapped element is encountered (whether XML schema validation is enabled or not). This is because that element is not valid against the JAXB metadata. Note that by default a JAXB impl will not fail on ERROR only on FATAL_ERROR.
|
|
|
|
Powered by
FUDForum. Page generated in 0.02857 seconds