Woodstox : Steps In Loading of Woodstox Classes


Woodstox classes are loaded using
. The steps involved in loading of Woodstox classes is explained below:

  1. javax.xml.stream.XMLInputFactory.newInstance() is called by client code
  2. The file ‘META-INF/services/javax.xml.stream.XMLInputFactory’ is searched in the current classpath
  3. 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
  4. The contents of ‘META-INF/services/javax.xml.stream.XMLInputFactory’ (as shown below) are read.
  5. The name of the Woodstox class, WstxInputFactory, mentioned in the above step is read
  6. WstxInputFactory class is loaded using Java Reflection and returned
  7. In all the sample programs,
    WstxInputFactory class is loaded using the above steps.

    Other Woodstox classes corresponding to for schema validation (DTD, RelaxNG, W3c),
    XMLEventFactory and
    XMLOutputFactory (see image in step 3) are loaded in a similar manner as mentioned in the steps above.

Leave a Comment