RE: [xsl] ancestor

Subject: RE: [xsl] ancestor
From: "Jiang, Peiyun" <Peiyun.Jiang@xxxxxxxxxxxxxx>
Date: Mon, 18 Oct 2004 14:40:01 -0400
>Has this test returned a value for you?
><xsl:if test="$inlineequation/@id=./@id"><xsl:value-of
>select="position()" /></xsl:if>
Yes, I got the one I needed.

>you want to compare its value to the value of the current elements id
attribute 
>which would look like this:
><xsl:if test="$inlineequation/@id = current()/@id">
><xsl:value-of select="position()" />
></xsl:if>
Yes, you are right.

More generally, I'm trying to get the position of an element in a selected
list of elements. All elements are identifiable by   @id. If the element is
not selected (even if it matches the element name) in the list, then nothing
is output. I need the position of that element a few times in a matching
template for that element in different places.

Thanks.

Peiyun

Current Thread