【发布时间】:2012-11-23 12:15:29
【问题描述】:
我正在对 XML 文档中的 saxon 进行 xstl 转换。
该文档不是标准有效的 XML,我想保留在其中找到的所有 <![CDATA[< 元素。
但是使用 .xsl 文件进行转换
Transformer trans = TransformerFactory.newInstance().newTransformer(new StreamSource(new File("foo.xsl"));
trans.transform(new StreamSource(new File("foo.xml"), new StreamResult(new File("output.xml")));
导致删除这些 CDATA 条目。我怎样才能防止这种情况发生?
【问题讨论】: