cfoster / saxon-jing

Extension Functions allowing Saxon to validate documents against RelaxNG Schemas
http://www.cfoster.net/saxon-jing/
Other
11 stars 3 forks source link

java.lang.NullPointerException at com.saxonica.functions.hof.CoercedFunction.call #2

Closed AirQuick closed 7 years ago

AirQuick commented 7 years ago

Hi, Just started trying saxon-jing. When I run "2. Example XSLT stylesheet" with Saxon-EE 9.7.0.14, it terminates as follows. Is it working at your end?

>java -cp jing-20091111.jar;saxon9ee.jar;saxon-jing-0.9.0.jar net.sf.saxon.Transform -init:net.cfoster.saxonjing.JingInitializer -it -xsl:my-stylesheet.xsl
java.lang.NullPointerException
        at com.saxonica.functions.hof.CoercedFunction.call(CoercedFunction.java:145)
        at net.sf.saxon.functions.ApplyFn.call(ApplyFn.java:155)
        at net.sf.saxon.expr.FunctionCall.iterate(FunctionCall.java:546)
        at net.sf.saxon.expr.instruct.BlockIterator.next(BlockIterator.java:49)
        at net.sf.saxon.value.SequenceExtent.<init>(SequenceExtent.java:87)
        at net.sf.saxon.value.SequenceExtent.makeSequenceExtent(SequenceExtent.java:111)
        at net.sf.saxon.expr.instruct.GlobalVariable.getSelectValue(GlobalVariable.java:641)
        at net.sf.saxon.expr.instruct.GlobalVariable.actuallyEvaluate(GlobalVariable.java:722)
        at net.sf.saxon.expr.instruct.GlobalVariable.evaluateVariable(GlobalVariable.java:690)
        at net.sf.saxon.expr.GlobalVariableReference.evaluateVariable(GlobalVariableReference.java:123)
        at net.sf.saxon.expr.VariableReference.process(VariableReference.java:517)
        at net.sf.saxon.expr.instruct.NamedTemplate.expand(NamedTemplate.java:259)
        at net.sf.saxon.Controller.callTemplate(Controller.java:2420)
        at net.sf.saxon.s9api.Xslt30Transformer.callTemplate(Xslt30Transformer.java:707)
        at net.sf.saxon.Transform.processFile(Transform.java:1232)
        at net.sf.saxon.Transform.doTransform(Transform.java:795)
        at net.sf.saxon.Transform.main(Transform.java:77)
Fatal error during transformation: java.lang.NullPointerException:  (no message)
cfoster commented 7 years ago

Could you please provide the XSLT and RNC to reproduce the error?

Otherwise, if you just want to specifically test whether Saxon Jing works with Saxon EE 9.7.0.14 then Download the repo and change the pom.xml on Lines 92 and 100 to reference Saxon EE 9.7.0.14 and run the tests.

If you don't come back in the next couple of days on this, I'll try to run the tests with Saxon EE 9.7.0.14 myself and update the ticket.

cfoster commented 7 years ago

Just noticed you specifically referenced the Stylesheet on my website, I'll come back to you.

cfoster commented 7 years ago

Definitely a bug. Thank you for raising this.

In the mean time, remove the as attribute sequence-type tests on the xsl:variable elements and it should work.

as="function(node()) as empty-sequence()"
as="function(node()) as element(report)"
cfoster commented 7 years ago

@AirQuick Saxon Jing 0.9.1 available at http://www.cfoster.net/saxon-jing/download/

AirQuick commented 7 years ago

Now the example is working. Thanks!