Hi Scott,
it may that it is a problem with Expressions or Parameters because I found
a new very similar bug.
This is the template which does not work correct:
<xsl:template match="xref">
<xsl:param name="idref" select="string(@xrefid)"/>
<a>
<xsl:attribute name="href">#<xsl:value-of select="@xrefid"/>
</xsl:attribute>
<xsl:choose>
<xsl:when test="string(@xidtype)=string('text')">Siehe <xsl:value-of
select="substring(//*[@id=$idref]//*[1],1,15)"/>...
 </xsl:when>
<xsl:when test="string(@xidtype)=string('table')">Tabelle
<xsl:value-of select="count(//*[@id=$idref]/preceding::table)
+1"/></xsl:when>
<xsl:when test="string(@xidtype)=string('figure')">Abbildung
<xsl:value-of select="count(//*[@id=$idref]/preceding::figure)
+1"/></xsl:when>
<xsl:when test="string(@xidtype)=string('hspot')">Abb. <xsl:value-of
select="count(//*[@id=$idref]/preceding::figure)+1"/></xsl:when>
<xsl:otherwise>
<xsl:value-of select="@xidtype"/>Â <xsl:value-of
select="@xrefid"/>,</xsl:otherwise>
</xsl:choose>
<xsl:apply-templates select="@xrefitem"/>
</a>
This following instruction returns always the same, the value of the first occurence.
<xsl:when test="string(@xidtype)=string('hspot')">Abb. <xsl:value-of
select="count(//*[@id=$idref]/preceding::figure)+1"/></xsl:when>
I have attached an example. Please look at the links inside the results. Xalan with
STree returns the same as Saxon but I have canceled
it after two minutes because Saxon needs only one second.
Regards
Thomas
(See attached file: problem.zip)
.ZIP File