I have a woodstox and and java SE 1.6 stax parser in the classpath but woodstox seems to get selected by default. However in certain cases I'd like to use the default Java stax parser. Is there any way to specify which implementation to use?
Easiest way is to just directly instantiate one you want -- there is no need to use XMLInputFactory.newInstance()
; for Woodstox you would instantiate com.ctc.wstx.stax.WstxInputFactory
. For Sun implementation it is something else (com.sun.sjsxp or such) -- you can see class name if you instantiate it via Stax API when Woodstox jar is not in classpath.
But if you absolutely want to use indirection, value of system property "javax.xml.stream.XMLInputFactory" is used, as per javadocs: value is the name of class to instantiate.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With