我们正在将应用程序升级到 java6,并且与 java 5 一起使用的 xsl 转换现在返回一个空文档
以前有人见过这样的事情吗?如果有必要的话,我会发布 xsl 和 xml,但我必须从中取出敏感数据。
用于处理 XSL 转换的代码:
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer(new DOMSource( xslDoc));
DOMResult domresult = new DOMResult();
transformer.transform(new DOMSource(xmlDoc), domresult);
Node node = domresult.getNode();
resultDoc = (Document) node;
Has anybody seen anything like this before? I will post the xsl and xml if I have to but I would have to take sensitive data out of it.
The code used to handle the XSL transformation:
TransformerFactory tFactory = TransformerFactory.newInstance();
Transformer transformer = tFactory.newTransformer(new DOMSource( xslDoc));
DOMResult domresult = new DOMResult();
transformer.transform(new DOMSource(xmlDoc), domresult);
Node node = domresult.getNode();
resultDoc = (Document) node;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
从来没见过它变成空白的。对于 JAVA6(也兼容 1.5),我有以下正在运行的代码,区别似乎在于使用的 TransformerFactory 上。
这能解决您的问题吗?
Never seen it going blank. For JAVA6 (also compatible with 1.5), I have the following code that is working, the difference seems to on TransformerFactory used.
Does this correct your issue?