Re: [xsl] Relative XPATH between 2 nodes

Subject: Re: [xsl] Relative XPATH between 2 nodes
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Sat, 29 Jan 2005 10:02:53 +1100
This can be achieved in two different ways:

  1. Having the two nodes, then finding their first common ancestor up
in the hierarchy, then constructing the path down to the second node
from the common ancestor. This is straightforward.

  2. Using the strings (the XPath expressions ) for the two nodes.
This is much harder. For a similar solution for filenames in a tree
filesystem see:

     http://groups.google.co.uk/groups?hl=en&lr=&ie=UTF-8&oe=UTF-8&threadm=b8ujil%24dpl9r%241%40ID-152440.news.dfncis.de&rnum=1&prev=/groups%3Fq%3Dnovatchev%2Brelative%2Bpath%26hl%3Den%26lr%3D%26ie%3DUTF-8%26oe%3DUTF-8%26selm%3Db8ujil%2524dpl9r%25241%2540ID-152440.news.dfncis.de%26rnum%3D1


Cheers,
Dimitre Novatchev.


On Fri, 28 Jan 2005 09:34:33 -0500, Lyublinski, Leonid
<Leonid.Lyublinski@xxxxxxxxxxxxxxxxxxxx> wrote:
> This one should be challenging.
> 
> How to find a relative path from node A to node B if we know absolute
> paths for each of the nodes.
> I'm looking for general algorithm, logic, or idea which will help to
> avoid redundant steps.
> Maybe anybody has some prototype on this.
> Thanks
> 
> ------------------------------------------------------------------------------
> CONFIDENTIALITY  NOTICE:   This message is  intended only for the use of
> the  individual or  entity to  which it is  addressed  and  may  contain
> information  that is privileged,  confidential or exempt from disclosure
> by law.  If the reader of this message is not the intended recipient, or
> the  employee  or agent responsible  for delivering  the message  to the
> intended  recipient,  you  are  hereby  notified that  you are  strictly
> prohibited  from   printing,  storing,  disseminating,  distributing  or
> copying  this message.   If you have  received  this message  in  error,
> please notify us immediately  by replying to the message and deleting it
> from your computer.   Neither this information block,  the typed name of
> the sender,  nor anything else in this message is intended to constitute
> an electronic signature,  unless a specific statement to the contrary is
> included in this message.  Thank you, Antares Management Solutions.
> ==============================================================================

Current Thread