Page 1 of 1

Oxygen-21.1 throws Java errors for XSLT transformations via Ant taks (while the XSLT itself is fine)

Posted: Tue Jun 11, 2019 4:50 pm
by Ron Van den Branden
Hi,

I'm facing an issue with Oxygen Editor 21.1, build 2019052108, running on Windows 10 Professional (version 1903).

I have an XSLT stylesheet which is producing errors when invoked via an Ant transformation task on some XML input files. I'll quote the errors below, but first some other observations that might be relevant.

Yet, when that same XSLT stylesheet is run via either the XSLT debugger, or an XSLT transformation task (all with Saxon-9.8.0.12), all goes well, without errors. Also, when that same Ant taks with the same execution parameters is executed with Oxygen-19.1 (shipping with Saxon-9.7.0.19), the process succeeds without errors.

So, for one reason or other, Oxygen-21.1 is throwing errors when an XSLT stylesheet is processed via an Ant task, even though the same XSLT stylesheet run directly via Saxon-9.8.0.12 is working without errors. Here's an error log:

Code: Select all

     [echo] F:/debugtest/test/._xslt_debug/_debug_OPENEDITION_test.xml
     [java] java.lang.RuntimeException: Internal error evaluating template rule  at line 138 in module file:/C:/Program%20Files/Oxygen%20XML%20Editor%2021/frameworks/tei//xml/tei/stylesheet/profiles/jtei/openedition/to.xsl
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:374)
     [java] 	at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:505)
     [java] 	at net.sf.saxon.trans.TextOnlyCopyRuleSet.process(TextOnlyCopyRuleSet.java:69)
     [java] 	at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:481)
     [java] 	at net.sf.saxon.Controller.transformDocument(Controller.java:2497)
     [java] 	at net.sf.saxon.Controller.transform(Controller.java:2064)
     [java] 	at net.sf.saxon.s9api.Xslt30Transformer.applyTemplates(Xslt30Transformer.java:593)
     [java] 	at net.sf.saxon.Transform.processFile(Transform.java:1259)
     [java] 	at net.sf.saxon.Transform.doTransform(Transform.java:782)
     [java] 	at net.sf.saxon.Transform.main(Transform.java:81)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     [java] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     [java] 	at java.lang.reflect.Method.invoke(Unknown Source)
     [java] 	at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:221)
     [java] 	at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:154)
     [java] 	at org.apache.tools.ant.taskdefs.Java.run(Java.java:834)
     [java] 	at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:228)
     [java] 	at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:137)
     [java] 	at org.apache.tools.ant.taskdefs.Java.execute(Java.java:110)
     [java] 	at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:293)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     [java] 	at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
     [java] 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
     [java] 	at java.lang.reflect.Method.invoke(Unknown Source)
     [java] 	at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:106)
     [java] 	at org.apache.tools.ant.Task.perform(Task.java:348)
     [java] 	at org.apache.tools.ant.Target.execute(Target.java:435)
     [java] 	at org.apache.tools.ant.Target.performTasks(Target.java:456)
     [java] 	at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1405)
     [java] 	at org.apache.tools.ant.Project.executeTarget(Project.java:1376)
     [java] 	at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
     [java] 	at org.apache.tools.ant.Project.executeTargets(Project.java:1260)
     [java] 	at org.apache.tools.ant.Main.runBuild(Main.java:857)
     [java] 	at org.apache.tools.ant.Main.startAnt(Main.java:236)
     [java] 	at org.apache.tools.ant.launch.Launcher.run(Launcher.java:287)
     [java] 	at org.apache.tools.ant.launch.Launcher.main(Launcher.java:113)
     [java] Caused by: java.lang.RuntimeException: Internal error evaluating template rule  at line 977 in module file:/C:/Program%20Files/Oxygen%20XML%20Editor%2021/frameworks/tei//xml/tei/stylesheet/profiles/jtei/openedition/to.xsl
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:374)
     [java] 	at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:505)
     [java] 	at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:295)
     [java] 	at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:252)
     [java] 	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
     [java] 	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:170)
     [java] 	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:337)
     [java] 	at net.sf.saxon.expr.instruct.Copy.processLeavingTail(Copy.java:415)
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:357)
     [java] 	... 36 more
     [java] Caused by: java.lang.RuntimeException: Internal error evaluating template rule  at line 977 in module file:/C:/Program%20Files/Oxygen%20XML%20Editor%2021/frameworks/tei//xml/tei/stylesheet/profiles/jtei/openedition/to.xsl
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:374)
     [java] 	at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:505)
     [java] 	at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:295)
     [java] 	at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:252)
     [java] 	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
     [java] 	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:170)
     [java] 	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:337)
     [java] 	at net.sf.saxon.expr.instruct.Copy.processLeavingTail(Copy.java:415)
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:357)
     [java] 	... 44 more
     [java] Caused by: java.lang.RuntimeException: Internal error evaluating template rule  at line 977 in module file:/C:/Program%20Files/Oxygen%20XML%20Editor%2021/frameworks/tei//xml/tei/stylesheet/profiles/jtei/openedition/to.xsl
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:374)
     [java] 	at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:505)
     [java] 	at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:295)
     [java] 	at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:252)
     [java] 	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
     [java] 	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:170)
     [java] 	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:337)
     [java] 	at net.sf.saxon.expr.instruct.Copy.processLeavingTail(Copy.java:415)
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:357)
     [java] 	... 52 more
     [java] Caused by: java.lang.RuntimeException: Internal error evaluating template rule  at line 977 in module file:/C:/Program%20Files/Oxygen%20XML%20Editor%2021/frameworks/tei//xml/tei/stylesheet/profiles/jtei/openedition/to.xsl
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:374)
     [java] 	at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:505)
     [java] 	at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:295)
     [java] 	at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:252)
     [java] 	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
     [java] 	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:170)
     [java] 	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:337)
     [java] 	at net.sf.saxon.expr.instruct.Copy.processLeavingTail(Copy.java:415)
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:357)
     [java] 	... 60 more
     [java] Caused by: java.lang.RuntimeException: Internal error evaluating template rule  at line 977 in module file:/C:/Program%20Files/Oxygen%20XML%20Editor%2021/frameworks/tei//xml/tei/stylesheet/profiles/jtei/openedition/to.xsl
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:374)
     [java] 	at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:505)
     [java] 	at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:295)
     [java] 	at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:252)
     [java] 	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
     [java] 	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:170)
     [java] 	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:337)
     [java] 	at net.sf.saxon.expr.instruct.Copy.processLeavingTail(Copy.java:415)
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:357)
     [java] 	... 68 more
     [java] Caused by: java.lang.RuntimeException: Internal error evaluating template rule  at line 977 in module file:/C:/Program%20Files/Oxygen%20XML%20Editor%2021/frameworks/tei//xml/tei/stylesheet/profiles/jtei/openedition/to.xsl
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:374)
     [java] 	at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:505)
     [java] 	at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:295)
     [java] 	at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:252)
     [java] 	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
     [java] 	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:170)
     [java] 	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:337)
     [java] 	at net.sf.saxon.expr.instruct.Copy.processLeavingTail(Copy.java:415)
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:357)
     [java] 	... 76 more
     [java] Caused by: java.lang.RuntimeException: Internal error evaluating template rule  at line 326 in module file:/C:/Program%20Files/Oxygen%20XML%20Editor%2021/frameworks/tei//xml/tei/stylesheet/profiles/jtei/openedition/to.xsl
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:374)
     [java] 	at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:505)
     [java] 	at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:295)
     [java] 	at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:252)
     [java] 	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
     [java] 	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:170)
     [java] 	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:337)
     [java] 	at net.sf.saxon.expr.instruct.Copy.processLeavingTail(Copy.java:415)
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:357)
     [java] 	... 84 more
     [java] Caused by: java.lang.RuntimeException: Internal error evaluating template rule  at line 618 in module file:/C:/Program%20Files/Oxygen%20XML%20Editor%2021/frameworks/tei//xml/tei/stylesheet/profiles/jtei/openedition/to.xsl
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:374)
     [java] 	at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:505)
     [java] 	at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:295)
     [java] 	at net.sf.saxon.expr.instruct.ApplyTemplates.process(ApplyTemplates.java:248)
     [java] 	at net.sf.saxon.expr.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:302)
     [java] 	at net.sf.saxon.expr.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:50)
     [java] 	at net.sf.saxon.expr.parser.ExpressionTool.evaluate(ExpressionTool.java:329)
     [java] 	at net.sf.saxon.expr.LetExpression.eval(LetExpression.java:519)
     [java] 	at net.sf.saxon.expr.LetExpression.process(LetExpression.java:588)
     [java] 	at net.sf.saxon.expr.instruct.ForEach.processLeavingTail(ForEach.java:472)
     [java] 	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
     [java] 	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:170)
     [java] 	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:337)
     [java] 	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:284)
     [java] 	at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:879)
     [java] 	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
     [java] 	at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:263)
     [java] 	at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:353)
     [java] 	at net.sf.saxon.expr.instruct.CallTemplate.processLeavingTail(CallTemplate.java:411)
     [java] 	at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:879)
     [java] 	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:170)
     [java] 	at net.sf.saxon.expr.instruct.ForEachGroup.processLeavingTail(ForEachGroup.java:595)
     [java] 	at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:709)
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:357)
     [java] 	... 92 more
     [java] Caused by: java.lang.RuntimeException: Internal error evaluating template rule  at line 73 in module file:/C:/Program%20Files/Oxygen%20XML%20Editor%2021/frameworks/tei/xml/tei/stylesheet/profiles/jtei/jtei.common.xsl
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:374)
     [java] 	at net.sf.saxon.trans.Mode.applyTemplates(Mode.java:505)
     [java] 	at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:295)
     [java] 	at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:252)
     [java] 	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
     [java] 	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:170)
     [java] 	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:337)
     [java] 	at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:284)
     [java] 	at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:170)
     [java] 	at net.sf.saxon.expr.LetExpression.process(LetExpression.java:596)
     [java] 	at net.sf.saxon.expr.instruct.ForEach.processLeavingTail(ForEach.java:472)
     [java] 	at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:709)
     [java] 	at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:263)
     [java] 	at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:353)
     [java] 	at net.sf.saxon.expr.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:302)
     [java] 	at net.sf.saxon.expr.instruct.DocumentInstr.evaluateItem(DocumentInstr.java:50)
     [java] 	at net.sf.saxon.expr.parser.ExpressionTool.evaluate(ExpressionTool.java:329)
     [java] 	at net.sf.saxon.expr.LetExpression.eval(LetExpression.java:519)
     [java] 	at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:700)
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:357)
     [java] 	... 115 more
     [java] Caused by: java.lang.ArrayIndexOutOfBoundsException: Local variable $node uses slot 0 but no slots are allocated on the stack frame
     [java] 	at net.sf.saxon.expr.LocalVariableReference.evaluateVariable(LocalVariableReference.java:126)
     [java] 	at net.sf.saxon.expr.VariableReference.iterate(VariableReference.java:538)
     [java] 	at net.sf.saxon.expr.ItemChecker.iterate(ItemChecker.java:227)
     [java] 	at net.sf.saxon.expr.SlashExpression.iterate(SlashExpression.java:899)
     [java] 	at net.sf.saxon.expr.CardinalityChecker.evaluateItem(CardinalityChecker.java:280)
     [java] 	at net.sf.saxon.expr.ValueComparison.effectiveBooleanValue(ValueComparison.java:691)
     [java] 	at net.sf.saxon.pattern.BasePatternWithPredicate.matchesPredicate(BasePatternWithPredicate.java:126)
     [java] 	at net.sf.saxon.pattern.BasePatternWithPredicate.matches(BasePatternWithPredicate.java:118)
     [java] 	at net.sf.saxon.pattern.BasePatternWithPredicate.matches(BasePatternWithPredicate.java:115)
     [java] 	at net.sf.saxon.trans.rules.Rule.matches(Rule.java:250)
     [java] 	at net.sf.saxon.trans.SimpleMode.ruleMatches(SimpleMode.java:686)
     [java] 	at net.sf.saxon.trans.SimpleMode.searchRuleChain(SimpleMode.java:660)
     [java] 	at net.sf.saxon.trans.SimpleMode.getRule(SimpleMode.java:550)
     [java] 	at net.sf.saxon.expr.accum.AccumulatorData.visit(AccumulatorData.java:108)
     [java] 	at net.sf.saxon.expr.accum.AccumulatorData.visit(AccumulatorData.java:119)
     [java] 	at net.sf.saxon.expr.accum.AccumulatorData.buildIndex(AccumulatorData.java:77)
     [java] 	at net.sf.saxon.expr.accum.AccumulatorManager.getAccumulatorData(AccumulatorManager.java:115)
     [java] 	at net.sf.saxon.functions.AccumulatorFn.getAccumulatorValue(AccumulatorFn.java:64)
     [java] 	at net.sf.saxon.functions.AccumulatorFn.call(AccumulatorFn.java:91)
     [java] 	at net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:547)
     [java] 	at net.sf.saxon.expr.FilterExpression.iterate(FilterExpression.java:1139)
     [java] 	at net.sf.saxon.expr.NumberSequenceFormatter.evaluateItem(NumberSequenceFormatter.java:206)
     [java] 	at net.sf.saxon.expr.instruct.ValueOf.evaluateItem(ValueOf.java:317)
     [java] 	at net.sf.saxon.expr.instruct.ValueOf.evaluateItem(ValueOf.java:41)
     [java] 	at net.sf.saxon.expr.instruct.SimpleNodeConstructor.iterate(SimpleNodeConstructor.java:288)
     [java] 	at net.sf.saxon.expr.instruct.ForEach.map(ForEach.java:507)
     [java] 	at net.sf.saxon.expr.ContextMappingIterator.next(ContextMappingIterator.java:61)
     [java] 	at net.sf.saxon.om.MemoSequence$ProgressiveIterator.next(MemoSequence.java:227)
     [java] 	at net.sf.saxon.expr.SingletonAtomizer.evaluateItem(SingletonAtomizer.java:213)
     [java] 	at net.sf.saxon.expr.SingletonAtomizer.evaluateItem(SingletonAtomizer.java:30)
     [java] 	at net.sf.saxon.expr.parser.Evaluator$4.evaluate(Evaluator.java:85)
     [java] 	at net.sf.saxon.expr.SystemFunctionCall.evaluateArguments(SystemFunctionCall.java:448)
     [java] 	at net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:545)
     [java] 	at net.sf.saxon.expr.instruct.BlockIterator.next(BlockIterator.java:49)
     [java] 	at net.sf.saxon.functions.FoldingFunction.call(FoldingFunction.java:59)
     [java] 	at net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:547)
     [java] 	at net.sf.saxon.expr.Expression.evaluateItem(Expression.java:843)
     [java] 	at net.sf.saxon.expr.Expression.evaluateAsString(Expression.java:902)
     [java] 	at net.sf.saxon.expr.instruct.SimpleNodeConstructor.processLeavingTail(SimpleNodeConstructor.java:218)
     [java] 	at net.sf.saxon.expr.instruct.ValueOf.processLeavingTail(ValueOf.java:287)
     [java] 	at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:709)
     [java] 	at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:687)
     [java] 	at net.sf.saxon.expr.instruct.TemplateRule.applyLeavingTail(TemplateRule.java:357)
     [java] 	... 134 more
     [java] Fatal error during transformation: java.lang.RuntimeException: Internal error evaluating template rule  at line 138 in module file:/C:/Program%20Files/Oxygen%20XML%20Editor%2021/frameworks/tei//xml/tei/stylesheet/profiles/jtei/openedition/to.xsl
     [java] Java Result: 2
Given the fact that the XSLT stylesheet runs fine outside of Ant, and inside Ant when executed with Oxygen-19.1, I suspect this might be an internal error with either Oxygen-21.1, Saxon-9.8.0.12, or the way both interact via Ant.

Kind regards,

Ron

Re: Oxygen-21.1 throws Java errors for XSLT transformations via Ant taks (while the XSLT itself is fine)

Posted: Wed Jun 12, 2019 5:35 pm
by adrian
Hello,

I can confirm the issue when using the version of Saxon-EE (9.8.0.12) bundled with Oxygen v21.1, even as a plain XSLT transformation. Saxon-PE seems to work fine though. It also works with Saxon-EE 9.6 and 9.7 (as add-ons).

One workaround is to install the Saxon-EE 9.7 add-on (Help > Install new add-ons, Default Update Site) and configure your ANT transformation scenario to use that version of Saxon instead. Edit the transformation scenario, go to Libraries and replace the "${oxygenHome}/lib/*saxon*9*.jar" entry path with the "saxon9ee.jar" path from the 'lib' folder of the Saxon-EE 9.7 add-on.
The lib folder is located in:

Code: Select all

C:\Users\<username>\AppData\Roaming\com.oxygenxml\extensions\v21.1\plugins\https___www.oxygenxml.com_InstData_Addons_default_updateSite.xml\oxygen-sample-plugin-tranformer-saxon-9-7-21.1\lib
Regards,
Adrian

Re: Oxygen-21.1 throws Java errors for XSLT transformations via Ant taks (while the XSLT itself is fine)

Posted: Thu Jun 13, 2019 10:55 am
by Ron Van den Branden
Hi Adrian,

Thanks for your confirmation and suggested solution. I should have checked, and indeed: the Saxon version running in Ant is reported as Saxon-EE 9.8.0.12J. In the past, we had switched our XSLT tranformations to Saxon-HE, since they aren't using any extension or schema-aware features, and some optimizations in Saxon-EE were throwing similar errors.

Since we're offering this transformation in a project and framework to users running different Oxygen versions, it would be more convenient to avoid this problem by switching the Ant transformation to Saxon-HE. Therefore, I'm wondering if there is a way to specify in Ant which Saxon version to use? The build file invokes the XSLT transformatoin via a plain Java task:

Code: Select all

  <target name="debug-openedition">
    <java classname="net.sf.saxon.Transform">
      <arg value="-s:${cfd}/${cfne}"/>
      <arg value="-xsl:${transformations.base}/openedition/to.xsl"/> 
      <arg value="-o:${cfd}/._xslt_debug/_debug_OPENEDITION_${dest.file.basename}.xml"/>
    </java>
  </target>
Is there perhaps a command-line argument, (or a different classname) to select Saxon-HE instead of Saxon-EE? Since optimizations are involved, the error can be avoided by switching off optimizations. If I add following command line argument, the transformation succeeds with Saxon-EE:

Code: Select all

      <arg value="-opt:0"/>
But then again, I don't know if this would just ruin performance, or does it effectively comes down to running Saxon in HE mode?

Kind regards,

Ron

Re: Oxygen-21.1 throws Java errors for XSLT transformations via Ant taks (while the XSLT itself is fine)

Posted: Thu Jun 13, 2019 11:46 am
by adrian
Hi,

As per the Saxon - Running XSLT from the Command Line documentation, you can use the -target:(EE|PE|HE|JS|JS2) command line argument.

e.g. For Saxon-HE

Code: Select all

      <arg value="-target:HE"/>
Interesting find regarding the optimizations. I can confirm that this problem is indeed avoided with optimizations disabled.
Regarding performance, from what I tested Saxon-EE 9.8.0.12 is a bit slower with optimizations off.

Regards,
Adrian

Re: Oxygen-21.1 throws Java errors for XSLT transformations via Ant taks (while the XSLT itself is fine)

Posted: Thu Jun 13, 2019 11:56 am
by Ron Van den Branden
Hi Adrian,

Ah, sorry, I had overlooked that argument. I can confirm: specifying "-target:HE" makes it work like a charm!

Thanks,

Ron