Project

Profile

Help

Saxon 9 and xsl:number lead to Error -999

Added by Anonymous almost 17 years ago

Legacy ID: #4737654 Legacy Poster: Joel Fisler (joelfisler)

I am using the xsl:number function to create the chapter numbers of lessons. Now the way I use it may be bit complicated: <xsl:number level="multiple" count="elml:lesson | elml:unit[(@role='student') or (@role=$role) or (not (@role))] | elml:selfAssessment | elml:summary | elml:furtherReading | elml:glossary[not(@visible='online') and not(@visible='none')] | elml:listOfFigures[not(@visible='online') and not(@visible='none')] | elml:listOfTables[not(@visible='online') and not(@visible='none')] | elml:index[not(@visible='online') and not(@visible='none')] | elml:bibliography[not(@visible='online') and not(@visible='none')] | elml:metadata[not(@visible='online') and not(@visible='none')] | elml:learningObject"/> This worked fine up to now. With the release of Saxon 9 I cannot transform my content anymore because I always get the error: [Saxon9B] -999Unknown The long command line version of this error can be found below. Now as soon as I delete this xsl:number element the transformation works fine. I cannot figure out why. Does anyone have a hint or clue? Where should I continue searching? It already took me about 7 hours to figure out that actually this statement is causing the -999 error but no I dont know how to replace it or what to change. To me everything seems correct... Thanks for your help. Joël (University of Zurich) java.lang.ArrayIndexOutOfBoundsException: -999 at net.sf.saxon.expr.XPathContextMinor.setLocalVariable(XPathContextMinor.java:349) at net.sf.saxon.expr.LetExpression.iterate(LetExpression.java:301) at net.sf.saxon.expr.Expression.effectiveBooleanValue(Expression.java:421) at net.sf.saxon.expr.BooleanExpression.effectiveBooleanValue(BooleanExpression.java:181) at net.sf.saxon.expr.BooleanExpression.effectiveBooleanValue(BooleanExpression.java:181) at net.sf.saxon.pattern.LocationPathPattern.internalMatches(LocationPathPattern.java:497) at net.sf.saxon.pattern.LocationPathPattern.matches(LocationPathPattern.java:409) at net.sf.saxon.pattern.UnionPattern.matches(UnionPattern.java:100) at net.sf.saxon.pattern.UnionPattern.matches(UnionPattern.java:100) at net.sf.saxon.pattern.UnionPattern.matches(UnionPattern.java:100) at net.sf.saxon.pattern.UnionPattern.matches(UnionPattern.java:100) at net.sf.saxon.pattern.UnionPattern.matches(UnionPattern.java:100) at net.sf.saxon.pattern.UnionPattern.matches(UnionPattern.java:100) at net.sf.saxon.pattern.UnionPattern.matches(UnionPattern.java:100) at net.sf.saxon.pattern.UnionPattern.matches(UnionPattern.java:100) at net.sf.saxon.pattern.UnionPattern.matches(UnionPattern.java:100) at net.sf.saxon.pattern.UnionPattern.matches(UnionPattern.java:100) at net.sf.saxon.om.Navigator.getNumberMulti(Navigator.java:467) at net.sf.saxon.instruct.NumberInstruction.evaluateItem(NumberInstruction.java:502) at net.sf.saxon.instruct.ValueOf.processLeavingTail(ValueOf.java:233) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:625) at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:625) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Template.expand(Template.java:192) at net.sf.saxon.instruct.CallTemplate.process(CallTemplate.java:255) at net.sf.saxon.instruct.CallTemplate.processLeavingTail(CallTemplate.java:279) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Instruction.process(Instruction.java:94) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298) at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:625) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Template.expand(Template.java:192) at net.sf.saxon.instruct.CallTemplate.process(CallTemplate.java:255) at net.sf.saxon.instruct.CallTemplate.processLeavingTail(CallTemplate.java:279) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Instruction.process(Instruction.java:94) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Instruction.process(Instruction.java:94) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:625) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:175) at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:343) at net.sf.saxon.instruct.ApplyTemplates$ApplyTemplatesPackage.processLeavingTail(ApplyTemplates.java:534) at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:315) at net.sf.saxon.instruct.ApplyTemplates.apply(ApplyTemplates.java:208) at net.sf.saxon.instruct.ApplyTemplates.process(ApplyTemplates.java:168) at net.sf.saxon.instruct.ForEach.processLeavingTail(ForEach.java:300) at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:551) at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:625) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Template.expand(Template.java:192) at net.sf.saxon.instruct.CallTemplate.process(CallTemplate.java:255) at net.sf.saxon.instruct.CallTemplate.processLeavingTail(CallTemplate.java:279) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Instruction.process(Instruction.java:94) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Instruction.process(Instruction.java:94) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Instruction.process(Instruction.java:94) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298) at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:625) at net.sf.saxon.instruct.Template.expand(Template.java:192) at net.sf.saxon.instruct.CallTemplate.process(CallTemplate.java:255) at net.sf.saxon.instruct.CallTemplate.processLeavingTail(CallTemplate.java:279) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Instruction.process(Instruction.java:94) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Instruction.process(Instruction.java:94) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Instruction.process(Instruction.java:94) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Instruction.process(Instruction.java:94) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298) at net.sf.saxon.instruct.Template.expand(Template.java:192) at net.sf.saxon.instruct.CallTemplate.process(CallTemplate.java:255) at net.sf.saxon.instruct.CallTemplate.processLeavingTail(CallTemplate.java:279) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Instruction.process(Instruction.java:94) at net.sf.saxon.instruct.ElementCreator.processLeavingTail(ElementCreator.java:298) at net.sf.saxon.instruct.Instruction.process(Instruction.java:94) at net.sf.saxon.instruct.ResultDocument.processLeavingTail(ResultDocument.java:513) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:625) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:175) at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:343) at net.sf.saxon.instruct.ApplyTemplates.apply(ApplyTemplates.java:208) at net.sf.saxon.instruct.ApplyTemplates.process(ApplyTemplates.java:168) at net.sf.saxon.instruct.ForEach.processLeavingTail(ForEach.java:300) at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:551) at net.sf.saxon.instruct.Choose.processLeavingTail(Choose.java:625) at net.sf.saxon.instruct.Block.processLeavingTail(Block.java:399) at net.sf.saxon.instruct.Template.applyLeavingTail(Template.java:175) at net.sf.saxon.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:343) at net.sf.saxon.Controller.transformDocument(Controller.java:1735) at net.sf.saxon.Controller.transform(Controller.java:1559) at net.sf.saxon.Transform.processFile(Transform.java:1036) at net.sf.saxon.Transform.doTransform(Transform.java:672) at net.sf.saxon.Transform.main(Transform.java:65) Fatal error during transformation: java.lang.ArrayIndexOutOfBoundsException: -999


Replies (7)

Please register to reply

RE: Saxon 9 and xsl:number lead to Error -999 - Added by Anonymous almost 17 years ago

Legacy ID: #4737658 Legacy Poster: Joel Fisler (joelfisler)

One last thing: I did read about the error: http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1855418&amp;group_id=29872&amp;atid=397617 but since I am not using "//" I dont think this is the same error. Or am I understanding the above thread wrong?

RE: Saxon 9 and xsl:number lead to Error -999 - Added by Anonymous almost 17 years ago

Legacy ID: #4737668 Legacy Poster: Michael Kay (mhkay)

First, this is very similar to one of the bugs that's fixed in 9.0.0.3, so please try that release. If the problem is still present in 9.0.0.3, please supply the stylesheet and a source document so that I can investigate. Michael Kay

RE: Saxon 9 and xsl:number lead to Error -999 - Added by Anonymous almost 17 years ago

Legacy ID: #4737671 Legacy Poster: Michael Kay (mhkay)

>I did read about the error: http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1855418&amp;group_id=29872&amp;atid=397617 That's the bug I was thinking of: and yes, it's not quite the same circumstances, but it could be a different way of invoking the same incorrect code, so I'd be grateful if you would check.

RE: Saxon 9 and xsl:number lead to Error -999 - Added by Anonymous almost 17 years ago

Legacy ID: #4737775 Legacy Poster: Joel Fisler (joelfisler)

Unfortunately this does not help as you can see here: I am using the latest version: > java -jar /Applications/eclipse/plugins/com.oxygenxml.editor_9.1.0/lib/saxon9.jar No source file name Saxon 9.0.0.3J from Saxonica Usage: see http://www.saxonica.com/documentation/using-xsl/commandline.html ... Now I run the following command: > java -jar /Applications/eclipse/plugins/com.oxygenxml.editor_9.1.0/lib/saxon9.jar ~/Documents/workspace/verfg/ch/de/text/ch.xml ~/Documents/workspace/verfg/_templates/verfg/online.xsl And get still the same erro: java.lang.ArrayIndexOutOfBoundsException: -999 at net.sf.saxon.expr.XPathContextMinor.setLocalVariable(XPathContextMinor.java:349) at net.sf.saxon.expr.LetExpression.iterate(LetExpression.java:301) ...... at net.sf.saxon.Transform.main(Transform.java:65) Fatal error during transformation: java.lang.ArrayIndexOutOfBoundsException: -999 I will submit the XSLT files but it first I need to prepare them. At the moment the whole transformation is made using about 10 XSLT files and way to complicated (using the eLML project www.elml.ch). I will try to cut it down and submit a simple XML/XSLT example. Thanks a lot anyway for your quick reply.

This is what causes the error... Why? - Added by Anonymous almost 17 years ago

Legacy ID: #4737840 Legacy Poster: Joel Fisler (joelfisler)

OK, so I striped everything that had nothing to do with the error. Take the following XML File: <?xml version="1.0" encoding="UTF-8"?> <lesson> <unit>blabla</unit> </lesson> And now transform it with this XSLT File: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="2.0" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:param name="role" select="'tutor'"/> <xsl:template match="/lesson | unit"> <xsl:number level="multiple" count="lesson | unit[@role=$role]"/> <xsl:apply-templates/> </xsl:template> </xsl:stylesheet> You will get Error -999! Now if you alter the xsl:number element and eg. delete "lesson |" it works. If you delete "@role=$role" it works. But this doesnt help. To me this example is perfectly valid and Saxon 9 should transform it. Correct me if I am wrong. Thanks for any help in advance

RE: This is what causes the error... Why? - Added by Anonymous almost 17 years ago

Legacy ID: #4737872 Legacy Poster: Michael Kay (mhkay)

Yes, there's no question it's a Saxon bug - the only question was whether it was a new bug or an old bug. Thanks for stripping it down to the essentials. I'll take a look at it tomorrow.

RE: This is what causes the error... Why? - Added by Anonymous almost 17 years ago

Legacy ID: #4740182 Legacy Poster: Michael Kay (mhkay)

Thanks for producing such a clear test case. I've decribed the bug at http://sourceforge.net/tracker/index.php?func=detail&amp;aid=1879041&amp;group_id=29872&amp;atid=397617, and have raised a patch. You can work around the problem by writing the predicate using the "eq" operator instead of "=".

    (1-7/7)

    Please register to reply