java - JAXB: Severity 2 events (fatal errors) instead of severity 1 events (errors) during XML validation -
during xml validation against xsd file using jaxb seem severity 2 events (fatal errors) instead of severity 1 events (errors).
to check impression used exact copy of code posted in blog entry jaxb , marshal/unmarshal schema validation @ blaise doughan's blog, using unmarshal demo. instead of 3 severity 1 events shown @ blog severity 2 events. here output:
event severity: 2 message: cvc-maxlength-valid: value 'jane doe' length = '8' not facet-valid respect maxlength '5' type 'stringmaxsize5'. linked exception: org.xml.sax.saxparseexception; systemid: file:/c:/.../workspace/jaxbtest/input.xml; linenumber: 2; columnnumber: 25; cvc-maxlength-valid: value 'jane doe' length = '8' not facet-valid respect maxlength '5' type 'stringmaxsize5'. locator line number: 2 column number: 25 offset: -1 object: null node: null url: file:/c:/.../workspace/jaxbtest/input.xml event severity: 2 message: cvc-type.3.1.3: value 'jane doe' of element 'name' not valid. linked exception: org.xml.sax.saxparseexception; systemid: file:/c:/.../workspace/jaxbtest/input.xml; linenumber: 2; columnnumber: 25; cvc-type.3.1.3: value 'jane doe' of element 'name' not valid. locator line number: 2 column number: 25 offset: -1 object: null node: null url: file:/c:/.../workspace/jaxbtest/input.xml event severity: 2 message: cvc-complex-type.2.4.d: invalid content found starting element 'phone-number'. no child element expected @ point. linked exception: org.xml.sax.saxparseexception; systemid: file:/c:/.../workspace/jaxbtest/input.xml; linenumber: 5; columnnumber: 19; cvc-complex-type.2.4.d: invalid content found starting element 'phone-number'. no child element expected @ point. locator line number: 5 column number: 19 offset: -1 object: null node: null url: file:/c:/.../workspace/jaxbtest/input.xml
in own project want collect invalid points of xml file. far doesn't work since severity 2 events invalid parts of xml file, if there value out of specified range.
how expected severity 1 classification simple xml validation errors? there mechanism changes classification of xml validation events in jaxb?
on other hand, configure exception handler continue if there fatal error, don't think idea.
originally, wanted use validationeventcollector of jaxb, collects first event since stops when gets fatal error (severity 2) case every validation problem far see.
i'm using java 1.8.0 , have had behaviour on windows system on mac.
Comments
Post a Comment