This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Position of a Child
- To: <xsl-list at lists dot mulberrytech dot com>
- Subject: Re: [xsl] Position of a Child
- From: Jörg Heinicke <joerg dot heinicke at gmx dot de>
- Date: Thu, 20 Sep 2001 20:55:05 +0200
- References: <4AD94ABEB713D411B1E300A0C99599261B2726@mail.bowneglobal.es>
- Reply-To: xsl-list at lists dot mulberrytech dot com
I don't know whether there is a shorter version, but the following code will
work:
<xsl:for-each select="*">
<xsl:if test="name()=$NodeName">
<xsl:value-of select="position()"/>
</xsl:if>
</xsl:for-each>
Joerg
> Hi all,
>
> I'm having problems getting the child's position() of the context node.
> I reference the child by its name (stored in a variable), like this:
>
> <xsl:value-of select="*[name()=$NodeName]"/>
>
> What I would like to get is the position of that child inside the context
> node.
> I don't seem to find the correct syntax for this.
>
> Thanks in advance,
> Frank.
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list