Array Index -1 in preceding-sibling
The Saxon XSLT and XQuery processor, developed by Saxonica
Brought to you by:
mhkay
An ArrayIndexOutOfBoundsException (with index -1) occurs when using a TailIterator with the preceding-sibling axis on a TinyTree. Typical query:
<xsl:template match="/">
<xsl:apply-templates <br=""> select="root/*/preceding-sibling::*
[@attrib='x'][position() > 1]"/>
</xsl:template>
Occurs in 8.9.0.4 and probably many previous releases; fixed in 9.0.
Caused because PrecedingSiblingEnumeration fails if next() is called after a previous call on next() has returned null indicating end of sequence; and TailIterator calls next() twice if the sequence is empty.
Logged In: YES
user_id=251681
Originator: YES
Fixed in 9.0.0.1