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

gettin value of a node

Subject: gettin value of a node
From: "Earl Spencer" <eapencer74@xxxxxxxxxxx>
Date: Fri, 20 Jul 2001 18:23:59 +0000
x 2 x y
Hi folks,

I have an xml like this which
<a>
<b1>
<x>1</x>
<y>hi</y>
<z>hello</z>
</b1>
<b2>
<x>1</x>
<y>hi</y>
<z>hello</z>
</b2>
<b3>
<x>2</x>
<y>u</y>
<z>king</z>
</b3>
<b4>
<x>3</x>
<y>hi</y>
<z>queen</z>
</b4>
</a>

when i transform i have to get a result like this

<group>
<b4>
<x>1</x>
<y>hi</y>
<z>hello</z>
</b4>
<b4>
<x>2</x>
<y>u</y>
<z>king</z>
</b4>
<b4>
<x>3</x>
<y>hi</y>
<z>queen</z>
</b4>
</group>

for this i used an xpath like this
								<xsl:for-each select="//x[not(. = following::x)]">
<xsl:variable name="pos">
  <xsl:value-of select="."/>
</xsl:variable>

which gets me all the unique x values
now when i write a statement like the below
								<xsl:value-of select="//y[//x=$pos]"/>

this statement does not work for me it gives me the same value for all the y's like it gives me
<group>
<b4>
<x>1</x>
<y>hi</y>
<z>hello</z>
</b4>
<b4>
<x>2</x>
<y>hi</y>
<z>king</z>
</b4>
<b4>
<x>3</x>
<y>hi</y>
<z>queen</z>
</b4>
</group>


can anyone tell me what is wrong please...

Thanx
Spencer




_________________________________________________________________ Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


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.