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]

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


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