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: Using position() with sorted node


Hi, Jenny.

position() does return the position of the current node in the current node
list (which is created using an <xsl:apply-templates> or <x

Can you show a little more of the code in question? When you say that it
needs to reference the previous node, do you mean that it needs to include
the string value of the previous node in the href attribute?



-----Original Message-----
From: Jenny Simpson [mailto:simpson@cs.utah.edu]
Sent: Tuesday, March 13, 2001 10:48 AM
To: XSL-List@lists.mulberrytech.com
Subject: [xsl] Using position() with sorted node


I have an xml document whose nodes are being sorted according to date.  I
am trying to use the position() function to reference these nodes, but
since they are sorted, their processing/output order is different from the
original document order.  Furthermore, I am using several for-each
statements which make it even more difficult to use position() since the 
position index starts back at 1 for each different set of nodes being
processed.  Is there a way to use position() or a similar function to 
reference the position of sorted nodes?  

Here is an example of the code I'm looking at.  This particular piece of
code was written by Jeremy Quinn.  Instead of day= referencing the
position of the node in the output, I need it to reference the node which
is processed immediately before this piece of code is executed.

<a>
        <xsl:attribute name="href">form/item-edit.xml?day=<xsl:value-of
        select="position()"/></xsl:attribute>
        <xsl:text>[edit]</xsl:text>
</a>

Thanks.  

Jenny Simpson


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

 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]