During using a key function in the xsl:number element's count attribute with a parameter given variable, Saxon throws an exception (attached).
In the latest version the message is:"java.lang.ArrayIndexOutOfBoundsException: Local variable has not been allocated a stack frame slot".
<xsl:key name="listItemsLevel1" use="parent::text:list/@text:style-name" match="text:list/*"/>
<xsl:number level="any" from="/*/office:body" count="key('listItemsLevel1', $listStyleName)"/>
If the used variable is created before xsl:number there is no problem, nevertheless $listStyleName is always given as string and never null or empty.
Please find my test scenario in the attached ZIP. As Saxon is build on Windows, I included a batch file (testscenario\test.bat) to trigger the XSL transformation (ODF to XHTML).
The problem occurs in testscenario\xslt\export\xhtml\body.xsl line 1070.
For the background:
What I am counting in an ODF are text:list-item all preceding text:list-items with the same level (=similar amount of text:list parents) and same text:list style (=style of a ancestor text:list) to create the numbering label.
In ODF even separated text:list have a continuous numbering, as long the text:list has the same style.