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

Filtering elements of a tree

Subject: Filtering elements of a tree
From: "Venkatesh Sutrave" <vmsutrave@xxxxxxxxxxxxxx>
Date: 8 May 2002 05:16:04 -0000
tree filtering
Hi all,
I am having an xml like this -

<Topic id="5" Text="music">
	<category id="6" Text="blues">
		<artist id="7" Text="bb king"/>
		<artist id="8" Text="lightnin hopkins"/>
	</category>
	<category id="6" Text="red">
		<Category id="11" Text="bb">
			<artist id="8" Text="lightnin hopkins"/>
		</Category>
	</category>
	<category id="6" Text="jazz">
		<category id="11" Text="bebop">
			<artist id="7" Text="charlie parker"/>
		</category>
		<artist id="7" Text="miles davis"/>
		<artist id="10" Text="john coltrane"/>
	</category>
</Topic>

I want to select the element artist with id=7 and its parent, grand parent and so on.
After transformation the xml should look like this-


<TreeNode id="5" Text="music">
	<TreeNode id="6" Text="blues">
		<TreeNode id="7" Text="bb king"/>
	</TreeNode>
	<TreeNode id="6" Text="jazz">
		<TreeNode id="11" Text="bebop">
			<TreeNode id="7" Text="charlie parker"/>
		</TreeNode>
		<TreeNode id="7" Text="miles davis"/>
	</TreeNode>
</TreeNode>

Please assist.
Thanks in advance,
Venkatesh
_________________________________________________________
Click below to visit monsterindia.com and review jobs in India or Abroad
http://monsterindia.rediff.com/jobs



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.