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

getting the node position in source xml in a variable

Subject: getting the node position in source xml in a variable
From: Gurvinder Singh <GurvinderS@xxxxxxxxxx>
Date: Wed, 27 Feb 2002 12:22:12 +0200
xml node position
I have a template which takes two node-sets as parameters. I loop thru one
of these nodeset using for-each and output the node value along with the
corresponding node in the second node-list.
Now the problem is that it works fine if i dont have a sort but with sort
only the first node list is sorted. So it takes the wrong corresponding
values from the second node-list.
because the position gives the position in the context. 
So i should use <xsl:number> but when i put the xsl:number in the variable
it always gives 1.
even the position() if inside <xsl:variable> gives always 1, but if used in
select attribute of <xsl:variable> it works fine

	<xsl:template name="lookup">
		<xsl:param name="name"/>
		<xsl:param name="datanodes"/>
		<xsl:param name="displaynodes"/>
			<xsl:attribute name="name"><xsl:value-of
				<xsl:sort select="."></xsl:sort>
				<xsl:variable name="num"
				<xsl:variable name="data"><xsl:value-of
				<option id="{$data}" value="{$data}">
select="$data"/>-<xsl:value-of select="."/>

Thanks & Regards

Amdocs Limited , Cyprus

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

Current Thread


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.
First Name
Last Name
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.