[xsl] position of an element

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

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

At the moment, my XML looks like this:

--- snip ---
	<content number="1">
	<content number="2">
	<content number="3">
	<content number="4">
	<content number="5">
--- 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:


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

Sebastian Schirmer

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

Current Thread