How to specify which stax analyzer to use

I have a woodstox and java SE 1.6 stax parser in the classpath, but woodstox seems to be selected by default. However, in some cases, I would like to use the standard Java stax parser. Is there a way to indicate which implementation to use?

+5
source share
2 answers

The easiest way is to simply create the instance you want - there is no need to use XMLInputFactory.newInstance(); for Woodstox you will create an instance com.ctc.wstx.stax.WstxInputFactory. For Sun's implementation, this is something else (com.sun.sjsxp or such) - you can see the class name if you create an instance through the Stax API when the Woodstox piece is not in the classpath.

, "javax.xml.stream.XMLInputFactory", javadocs: value - .

+7

, jboss woodstox , ( - ). :

        // Use BEA streaming parser to avoid runtime exceptions
        XMLOutputFactory xmlof = new XMLOutputFactoryBase();
0

All Articles