Converting Stax source code with Java
•
Java
I have some codes:
XMLInputFactory xif = XMLInputFactory.newInstance() TransformerFactory tf = TransformerFactory.newInstance("org.apache.xalan.processor.TransformerFactoryImpl",null) Transformer t = tf.newTransformer() DOMResult result = new DOMResult() t.transform(new StAXSource(reader),result)
This results in the following errors:
The reader object is of type com sun. org. apache. xerces. internal. impl. XMLStreamReaderImpl
Solution
So I foolishly tried the wrong thing This solves it:
System.setProperty("javax.xml.transform.TransformerFactory","com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl");
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码