Details
-
Type:
New Feature
-
Status:
Open
-
Priority:
Major
-
Resolution: Unresolved
-
Affects Version/s: JiBX 1.2.2
-
Fix Version/s: None
-
Component/s: core
-
Labels:None
-
Number of attachments :
Description
It's currently complicated to turn on schema validation in JiBX, involving the following procedure for input:
Create an instance of javax.xml.stream.XMLInputFactory with an implementation which supports validation (such as the one supplied by Sun as part of their JDKs), then call setProperty(XMLInputFactory.IS_VALIDATING, Boolean.TRUE) and create an actual parser with a createXMLStreamReader() call. Once you have the validating parser for your input, you can use the org.jibx.runtime.impl.StAXReaderWrapper constructor to wrap this as an IXMLReader instance, which can then be set on your org.jibx.runtime.impl.UnmarshallingContext unmarshalling context instance.
There should be an easier way of doing this.