[英]XML document structures must start and end within the same entity. xml to html using xslt
I am facing issue while trying to convert xml to html using xslt. 我在尝试使用xslt将xml转换为html时遇到问题。 following is the dummy code i am using to parse 以下是我用来解析的虚拟代码
**TransformerFactory tFactory = TransformerFactory.newInstance();
Source xslDoc = new StreamSource( xsltPath );
Source xmlDoc = new StreamSource( xmlPath );
oFileOutputStream=new FileOutputStream( htmlOutputPath );
htmlFile = oFileOutputStream;
Transformer transformer = tFactory.newTransformer( xslDoc );
transformer.transform( xmlDoc, new StreamResult( htmlFile ) );**
getting error as follow 得到错误如下
ERROR: 'XML document structures must start and end within the same entity.' 错误:“ XML文档结构必须在同一实体内开始和结束。” ERROR: 'com.sun.org.apache.xml.internal.utils.WrappedRuntimeException: XML document structures must start and end within the same entity.'|#] Any idea 错误:“ com.sun.org.apache.xml.internal.utils.WrappedRuntimeException:XML文档结构必须在同一实体内开始和结束。” |#]任何想法
It seems that you have closed the stream while transformer is still doing the work. 看来您在变压器仍在工作时已关闭流。 Please check that you have not closed any stream resources. 请检查您是否尚未关闭任何流资源。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.