[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

position() returns what?

Subject: position() returns what?
From: Morten Andersen <mortena@xxxxxxxxxx>
Date: Fri, 24 Oct 2003 10:37:45 +0200
morten andersen
ksI want to iterate through a list of elements and bewteen these elements put a link that indicates where in the xml-document we are.

For instance I want to transform:

<page>
  <part name="title-1" text="This is the text"></part>
  <part name="title-2" text="This is the text of the second part"></part>
</page>

Into something like:

<html><body>
<a href="editPart.action?number=0">Edit</a>
<h2>title-1</h2>
This is the text
....

My problem is how do I get the position / index of the part I'm transforming. I tryed with:

<xsl:template match="part">
    <xsl:value-of select="position()"/>

But this outputs equal numbers: 2,4,6,8,10,...
I did expect that it would output 0,1,2,3,4,5

I'm sure this comes down to the fact that I lack some background information, but I have a hard time finding that. What I'm looking for is a JavaDoc alike information preferably with good examples.




Thanks



Morten Andersen Master of applied mathematics and computer science Amanuensis (in e-learning)

The Maersk Institute of Production technology at Southern Danish University www.mip.sdu.dk
Campusvej 55
DK-5230 Odense M
Denmark
+45 6550-3654
+45 6171-1103
Jabber id: hat@xxxxxxxxx



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



Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.