我有一个Document对象doc,我想应用样式表转换输出,可是运行以后就报
XML-22101: (Fatal Error) DOMSource node as this type not supported.
这个错误,真搞不懂怎么回事了,奇怪的是,前天我还运行好好的,从昨天不知就怎么回事出错误了,我还以为是我改动了什么,可是我把以前的代码调出来还是运行错误,拜托各位高手帮帮忙,我都弄了两天了,还是解决不了,下面是转换代码
Source source = new DOMSource( doc);
File xsltFile = new File( xsltFileName );
StreamSource xsltSource = new StreamSource( xsltFile );
File outFile = new File( outFileName );
Result result = new StreamResult( outFile );
TransformerFactory tff = TransformerFactory.newInstance();
Transformer trans = tff.newTransformer(xsltSource);
trans.transform(source, result);