You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@xalan.apache.org by bu...@apache.org on 2002/06/24 15:58:44 UTC
DO NOT REPLY [Bug 10176] New: -
position() returns zero under apply-imports
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10176>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND
INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=10176
position() returns zero under apply-imports
Summary: position() returns zero under apply-imports
Product: XalanJ2
Version: 2.3
Platform: Other
OS/Version: Other
Status: NEW
Severity: Normal
Priority: Other
Component: Xalan
AssignedTo: xalan-dev@xml.apache.org
ReportedBy: David_Marston@lotus.com
Based on a report from Kai Ojansuu, I wrote the position102 test that has this
template:
<xsl:template match="c">
<xsl:text>
</xsl:text>
<apply level="main">
<xsl:text>Item </xsl:text>
<xsl:value-of select="@mark"/>
<xsl:text> is in position </xsl:text>
<xsl:value-of select="position()"/>
</apply>
<xsl:apply-imports/>
</xsl:template>
and the apply-imports will invoke this:
<xsl:template match="c">
<xsl:text>
</xsl:text>
<apply level="import">
<xsl:text>Item </xsl:text>
<xsl:value-of select="@mark"/>
<xsl:text> is in position </xsl:text>
<xsl:value-of select="position()"/>
</apply>
</xsl:template>
While the template at the main level returns positions of 1, 2, 3 for the c
elements, the imported one returns 0, 0, 0.
XSLT section 5.6 is a little terse, so we have to guess at the WG's intent.
I'll report an erratum to the WG.
WORKAROUND: Determine the position in the main-level template. Set a variable
to hold it, if necessary.