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

backtracking to find all parents till root

Subject: backtracking to find all parents till root
From: Rahil <qamar_rahil@xxxxxxxxxxx>
Date: Tue, 24 May 2005 11:45:06 +0100
xslt parent of parent

How do I backtrack the originating node of a descendant node, until I reach the root element? Hence if my given structure is of the form:

         <SubConcept id="990" name="Level1">
               <Child ref="567">Child1</Child>
               <Value ref="456">hasFeature BrokenBolt</Value>
         <SubConcept id="456" name="BrokenBolt">
               <Child ref="345">Child2</Child>
               <Value ref="123">hasProperty NextTime</Value>

I find my result in the <Value ref="123"> node with the contained value 'Time'. I can find the parent of this with the name() function 'BrokenBolt' as the control is at the <SubConcept id="456"> level. I'd like to iterate backwards using the 'id'='ref' match so I get a result of the order:

Match found: Next Parent: BrokenBolt Parent: Level1 Parent: SubConcepts

Thanks Rahil

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.