我正在尝试在我的一台服务器中使用XSLT组合一组XML文件,并为文件集(不是所有文件)收到以下错误:
\f0\fs22 \cf2 \cb3 \CocoaLigature0 Writing to file:/opt/Liferay-Bundle/tomcat-7.0.42/temp/temp128140163092620110910826941/OneShot/ParaNumber/cust_Story_u4f9.xml\
URIResolver.resolve href="Story_u4f9.xml" base="file:/opt/Liferay-Bundle/tomcat-7.0.42/temp/temp128140163092620110910826941/OneShot/ParaNumber/RawMap.xslt"\
Building tree for file:/opt/Liferay-Bundle/tomcat-7.0.42/temp/temp128140163092620110910826941/OneShot/ParaNumber/Story_u4f9.xml using class net.sf.saxon.tree.tiny.TinyBuilder\
Tree built in 6.666093ms\
Tree size: 287 nodes, 2003 characters, 388 attributes\
Writing to file:/opt/Liferay-Bundle/tomcat-7.0.42/temp/temp128140163092620110910826941/OneShot/ParaNumber/cust_Story_u4ac.xml\
URIResolver.resolve href="Story_u4ac.xml" base="file:/opt/Liferay-Bundle/tomcat-7.0.42/temp/temp128140163092620110910826941/OneShot/ParaNumber/RawMap.xslt"\
Building tree for file:/opt/Liferay-Bundle/tomcat-7.0.42/temp/temp128140163092620110910826941/OneShot/ParaNumber/Story_u4ac.xml using class net.sf.saxon.tree.tiny.TinyBuilder\
java.lang.RuntimeException: Internal error evaluating template rule at line 8 in module file:/opt/Liferay-Bundle/tomcat-7.0.42/temp/temp128140163092620110910826941/OneShot/ParaNumber/RawMap.xslt\
at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:366)\
at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:456)\
at net.sf.saxon.trans.TextOnlyCopyRuleSet.process(TextOnlyCopyRuleSet.java:65)\
at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:433)\
at net.sf.saxon.Controller.transformDocument(Controller.java:2277)\
at net.sf.saxon.Controller.transform(Controller.java:1854)\
at net.sf.saxon.s9api.XsltTransformer.transform(XsltTransformer.java:579)\
at net.sf.saxon.jaxp.TransformerImpl.transform(TransformerImpl.java:185)\
at com.library.hook.action.RunnableDemo.simpleTransformI2W(RunnableDemo.java:768)\
at com.library.hook.action.IdmlToXHTMLThread.run(IdmlToXHTMLThread.java:369)\
at java.lang.Thread.run(Thread.java:748)\
Caused by: java.lang.NullPointerException\
at oracle.xml.parser.v2.NonValidatingParser.resolveNS(NonValidatingParser.java:1803)\
at oracle.xml.parser.v2.NonValidatingParser.expandNamespace(NonValidatingParser.java:1754)\
at oracle.xml.parser.v2.NonValidatingParser.parseAttributes(NonValidatingParser.java:1445)\
at oracle.xml.parser.v2.NonValidatingParser.parseElement(NonValidatingParser.java:1274)\
at oracle.xml.parser.v2.NonValidatingParser.parseRootElement(NonValidatingParser.java:324)\
at oracle.xml.parser.v2.NonValidatingParser.parseDocument(NonValidatingParser.java:291)\
at oracle.xml.parser.v2.XMLParser.parse(XMLParser.java:207)\
at net.sf.saxon.event.Sender.sendSAXSource(Sender.java:451)\
at net.sf.saxon.event.Sender.send(Sender.java:153)\
at net.sf.saxon.functions.DocumentFn.makeDoc(DocumentFn.java:370)\
at net.sf.saxon.functions.DocumentFn$DocumentMappingFunction.mapItem(DocumentFn.java:190)\
at net.sf.saxon.expr.ItemMappingIterator.next(ItemMappingIterator.java:113)\
at net.sf.saxon.expr.sort.DocumentOrderIterator.<init>(DocumentOrderIterator.java:47)\
at net.sf.saxon.functions.DocumentFn.call(DocumentFn.java:161)\
at net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:546)\
at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:278)\
at net.sf.saxon.expr.instruct.ApplyTemplates.process(ApplyTemplates.java:251)\
at net.sf.saxon.expr.instruct.ResultDocument.processInstruction(ResultDocument.java:470)\
at net.sf.saxon.Configuration.processResultDocument(Configuration.java:2131)\
at net.sf.saxon.expr.instruct.ResultDocument.process(ResultDocument.java:382)\
at net.sf.saxon.expr.instruct.ResultDocument.processLeavingTail(ResultDocument.java:368)\
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:653)\
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:149)\
at net.sf.saxon.expr.instruct.ForEach.processLeavingTail(ForEach.java:453)\
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:149)\
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:364)\
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:311)\
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:149)\
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:364)\
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:311)\
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:149)\
at net.sf.saxon.expr.instruct.ResultDocument.processInstruction(ResultDocument.java:470)\
at net.sf.saxon.Configuration.processResultDocument(Configuration.java:2131)\
at net.sf.saxon.expr.instruct.ResultDocument.process(ResultDocument.java:382)\
at net.sf.saxon.expr.instruct.ResultDocument.processLeavingTail(ResultDocument.java:368)\
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:653)\
at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:711)\
at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:353)\
... 10 more\
我尝试了xslt的document()
和collection()
方法,可以用来组合文件。但得到同样的错误。
主要问题是,此错误仅在此特定服务器上发生。当我在本地或其他服务器上运行相同的文件集时,它运行没有任何问题。
此过程中使用以下内容:
XSLT 2.0
saxon 9.7.0-8
java 1.7.0_95
非常感谢任何帮助。
答案 0 :(得分:0)
它在Oracle XDK解析器中深深地崩溃了(Saxon只是传递了坏消息)。不幸的是,解析器不是开源的,我怀疑Oracle正在监控这个论坛,所以从技术上讲,你应该向Oracle提出支持请求。在实践中,您最好的方法可能是切换到不同的解析器:内置于JDK的解析器或Apache Xerces。
我怀疑你使用XDK解析器的唯一原因是它碰巧出现在类路径上,或出现在&#34;认可的库中#34; 。目录
使用方法Processor.setConfigurationProperty(FeatureKeys.SOURCE_PARSER_CLASS, className)
调用document()函数时,可以更改Saxon使用的解析器。