[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

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


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

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