Woodstox classes are loaded using
. The steps involved in loading of Woodstox classes is explained below:
- javax.xml.stream.XMLInputFactory.newInstance() is called by client code
- The file ‘META-INF/services/javax.xml.stream.XMLInputFactory’ is searched in the current classpath
- As the current classpath contains woodstox-core-asl-4.2.0.jar, the file ‘META-INF/services/javax.xml.stream.XMLInputFactory’ is found as shown below
- The contents of ‘META-INF/services/javax.xml.stream.XMLInputFactory’ (as shown below) are read.
- The name of the Woodstox class, WstxInputFactory, mentioned in the above step is read
- WstxInputFactory class is loaded using Java Reflection and returned
In all the sample programs,
WstxInputFactory class is loaded using the above steps.
Other Woodstox classes corresponding to for schema validation (DTD, RelaxNG, W3c),
XMLOutputFactory (see image in step 3) are loaded in a similar manner as mentioned in the steps above.