cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joerg Heinicke <>
Subject Re: XSLT: How does Cocoon use the context position ?
Date Wed, 05 Mar 2003 18:16:20 GMT
Hello Rainer,

XSLT 2 is only a working draft, so no recommendation. Not many xslt 
processors exist, which support XSLT 2. Xalan 2.3/2.4 does not, but is 
used in Cocoon. It supports XSLT 1.

Even if I have not been reading anything about XSLT 2, I'm sure it has 
nothing to do with it. I can not imagine that this behaviour changes 
between the two versions.

The context has not changed at the point, where you use 
<xsl:with-param/> and position(), so position() returns the context 
position of AwFall as you already have found out. But when you have a 
template matching on <Diagramm/> and when you use position() there, you 
will get the expected behaviour. Changing context and so the return 
value of position() already in <xsl:with-param/> makes no sense in my 



Rainer Ammermann wrote:
> Hello,
> the W3C says in XSLT 2.0:
> "[...] When an instruction such as xsl:apply-templates or
> xsl:for-each is used to process a sequence of items, the first item in
> the sequence is processed with a context position of 1, the second item
> with a context position of 2, and so on. The context position is
> returned by the XPath expression fn:position()."
> I tried it with cocoon 2/tomcat 4.1 , but it doesn't work within the
> <xsl:apply-templates>-element. Instead it takes the position of the node
> matched by the template. When I added an iteration with <xsl:for-each>,
> it worked fine.
> Anything wrong with my code or with cocoon ?
> <xsl:template match="AwFall">
> 	<xsl:apply-templates select="Diagramm">
> 	<xsl:with-param name="map" select="position()"/>
> 	</xsl:apply-templates>
> </xsl:template>
> With this the parameter 'map' is set to the position of <AwFall> not of
> <Diagramm>, which is actually needed.
> Thanks for any idea !
> Rainer Ammermann
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message