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: Position of a Child


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


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