UPDATE:
This problem is happening on saxon9ee-3.0.1j.  When I use saxon9ee-2.1.5j and saxon9ee-2.0.6j the build completes fine.

Regards,
David Bacher

From: David Bacher <david.bacher@freescale.com>
Date: Fri, 28 Jan 2011 09:16:32 -0600
To: Mailing list for the SAXON XSLT and XQuery processor <saxon-help@lists.sourceforge.net>
Subject: Internal error: invalid slot number for local variable (0)

Calling all Saxon gurus,

I'm trying to invoke a saxon transform in an ant build via the java ant task.  So the ant task looks something like this:

<java classname="net.sf.saxon.Transform"
output="${output}"
fork="true"
failonerror="true"
error="error.txt"
maxmemory="2048m"
dir="."> 

</java>

Here is the stack trace in the error.txt file:

Exception in thread "main" java.lang.AssertionError: Internal error: invalid slot number for local variable (0). Variable reference $gg:gg142515426 at line 704 of file:/ssds/sw/dita-ot-current/xsl/FreescaleXSL2-AHF/xslfo/topic2foImpl.xsl
at net.sf.saxon.expr.VariableReference.iterate(VariableReference.java:415)
at net.sf.saxon.expr.instruct.BlockIterator.next(BlockIterator.java:42)
at net.sf.saxon.expr.ItemMappingIterator.next(ItemMappingIterator.java:84)
at net.sf.saxon.expr.ItemMappingIterator.next(ItemMappingIterator.java:84)
at net.sf.saxon.expr.CardinalityChecker.evaluateItem(CardinalityChecker.java:216)
at net.sf.saxon.expr.Expression.process(Expression.java:488)
at net.sf.saxon.expr.CardinalityChecker.process(CardinalityChecker.java:268)
at net.sf.saxon.expr.instruct.Template.expand(Template.java:227)
at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:284)
at net.sf.saxon.expr.instruct.Instruction.getIteratorFromProcessMethod(Instruction.java:372)
at net.sf.saxon.expr.instruct.Instruction.iterate(Instruction.java:350)
at net.sf.saxon.expr.CardinalityChecker.evaluateItem(CardinalityChecker.java:213)
at net.sf.saxon.expr.ExpressionTool.evaluate(ExpressionTool.java:306)
at net.sf.saxon.expr.LetExpression.eval(LetExpression.java:344)
at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:550)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:569)
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:123)
at net.sf.saxon.expr.LetExpression.process(LetExpression.java:409)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:318)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:269)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:569)
at net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:208)
at net.sf.saxon.expr.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:368)
at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:232)
at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:196)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:569)
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:123)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:318)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:269)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:569)
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:123)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:318)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:269)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:569)
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:123)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:318)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:269)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:569)
at net.sf.saxon.expr.LetExpression.processLeavingTail(LetExpression.java:559)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:569)
at net.sf.saxon.expr.instruct.Template.expand(Template.java:225)
at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:284)
at net.sf.saxon.expr.instruct.CallTemplate.processLeavingTail(CallTemplate.java:308)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:569)
at net.sf.saxon.expr.instruct.Instruction.process(Instruction.java:123)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:318)
at net.sf.saxon.expr.instruct.ElementCreator.processLeavingTail(ElementCreator.java:269)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:569)
at net.sf.saxon.expr.instruct.Template.expand(Template.java:225)
at net.sf.saxon.expr.instruct.CallTemplate.process(CallTemplate.java:284)
at net.sf.saxon.expr.instruct.CallTemplate.processLeavingTail(CallTemplate.java:308)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:569)
at net.sf.saxon.expr.instruct.Choose.processLeavingTail(Choose.java:758)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:569)
at net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:208)
at net.sf.saxon.expr.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:368)
at net.sf.saxon.expr.instruct.ApplyTemplates.apply(ApplyTemplates.java:232)
at net.sf.saxon.expr.instruct.ApplyTemplates.processLeavingTail(ApplyTemplates.java:196)
at net.sf.saxon.expr.instruct.Block.processLeavingTail(Block.java:569)
at net.sf.saxon.expr.instruct.Template.applyLeavingTail(Template.java:208)
at net.sf.saxon.expr.instruct.ApplyTemplates.applyTemplates(ApplyTemplates.java:368)
at net.sf.saxon.Controller.transformDocument(Controller.java:1887)
at net.sf.saxon.Controller.transform(Controller.java:1737)
at net.sf.saxon.Transform.processFile(Transform.java:935)
at net.sf.saxon.Transform.doTransform(Transform.java:569)
at net.sf.saxon.Transform.main(Transform.java:72)

Any thoughts or suggestions would be greatly appreciated.

Thanks,
David Bacher