[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] gettin value of a node
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
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|