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

position of an element

Subject: position of an element
From: Sebastian Schirmer <schirmer@xxxxxxxxxxxxx>
Date: Fri, 25 May 2001 12:02:32 +0200
position of an element
Hello,

I think this is an easy to solve problem but I dont see the lights ...

At the moment, my XML looks like this:

--- snip ---
<elements>
	<content number="1">
	<content number="2">
	<content number="3">
	<content number="4">
	<content number="5">
</elements>
--- snip ---


In my XSL I have then access to the first / second / third / ... occuring
content element by comparing the number attribute values and I know exactly
that it is the first / second / third / ... content element in the document.
This is important for me to know.


How to manage it without assigning a number attribute to the content
elements in the XML? Maybe something like this:


Pseudo-code:

<template match="content">
	<xsl:value-of select="position-of-this-element-in-the-document()" />
</template>




Sebastian Schirmer



 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.