读书人

输出DOM中的XML的实业定义(InternalSu

发布时间: 2012-09-04 14:19:30 作者: rapoo

输出DOM中的XML的实体定义(InternalSubset)
问题描述

在使用DOM解析XML并输出文件的过程中,实体定义不在输出的文件。

原XML:

StringBuffer xmlFileName = new StringBuffer();xmlFileName.append("C:\\temp\\test.xml");DOMImplementationRegistry registry = DOMImplementationRegistry.newInstance();DOMImplementationLS impl = (DOMImplementationLS) registry.getDOMImplementation("LS");LSSerializer writer = impl.createLSSerializer();LSOutput output = impl.createLSOutput();FileWriter out = new FileWriter(new File(xmlFileName.toString()));output.setCharacterStream(out);writer.write(currentDocument, output);




读书人网 >XML SOAP

热点推荐