我有一些代码,例如:
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)
这会产生以下错误:
捕获:javax.xml.transform.TransformerException:无法转换 javax.xml.transform.stax.StAXSource 类型的源
阅读器对象的类型com.sun.org.apache.xerces.internal.impl.XMLStreamReaderImpl