This is the mail archive of the xsl-list@mulberrytech.com mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: question about position()



> first xsl example:
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform";>
> 
> 	<xsl:template match="/">
> 		<xsl:apply-templates select="r/a">
> 			<xsl:sort data-type="number" select="@at"/>
> 			<xsl:with-param name="p" select="position()"/>
> 		</xsl:apply-templates>
> 	</xsl:template>
> 
> 	<xsl:template match="a">
> 		<xsl:param name="p"/>
> 		<xsl:value-of select="$p"/><xsl:text>,</xsl:text>
> 	</xsl:template>
> 
> </xsl:stylesheet>
> 
> output from first example:
> -1,-1,-1,-1,

In addition to Jeni's mail it is worth to remark that this output mustn't
appear at all. position() should never return -1. The correct output is
1 I think, so it must be a bug in the XSLT processor you're using.

Cheers,
Oliver


/-------------------------------------------------------------------\
|  ob|do        Dipl.Inf. Oliver Becker                             |
|  --+--        E-Mail: obecker@informatik.hu-berlin.de             |
|  op|qo        WWW:    http://www.informatik.hu-berlin.de/~obecker |
\-------------------------------------------------------------------/


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]