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

Re: backtracking to find all parents till root[again]

Subject: Re: backtracking to find all parents till root[again]
From: Rahil <qamar_rahil@xxxxxxxxxxx>
Date: Tue, 24 May 2005 16:19:25 +0100
w3c obtain parent
Aron Bock wrote:

Rahil,

It's still not a watertight problem statement, but the following will produce what you want, and I imagine you can press it into better service if need be.

<snip/>


<xsl:apply-templates select="preceding-sibling::SubConcept[contains(Value, current()/@name)][1]"/>
</xsl:template>


</xsl:stylesheet>

Oh I think I understood where the confusion is. Its not that Im trying to find the sibling of a <SubConcept>. Rather Im trying to trace the origins of a particular value found somewhere in the file. I do this in an alternating mode

1st step: Obtain 'parent' of the child node that contains the value match e.g. 'NextTime'.
2nd step: Look if there is any id=ref match in the file e.g. in this case the Parent 'BrokenBolt' is referenced by a child node of 'Level1'. So they get connected to each other wth the help of id=ref.
3rd step. Obtain 'parent' of this child node that is referencing 'BrokenBolt'
4th step: Look if there are any id=ref match ....
...and so on and so forth.


Alternatively the sequence diagram is of the form

Found: NextTime
|
|__ Parent? Yes - BrokenBolt
|
|__ is BrokenBolt being referenced anywhere else in the file? Yes
|
|__ Parent? Yes - Level1
|
|__ is Level1 being referenced anywhere .........


.............. so on........

|
|__ until we reach root node <Top>. The recursion stops there!


Is this any clearer?

Thanks for helping out
Rahil

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.