RE: [xsl] How to find all parents having the same child?

Subject: RE: [xsl] How to find all parents having the same child?
From: "Lars Huttar" <lars_huttar@xxxxxxx>
Date: Tue, 17 Jun 2003 21:44:40 -0500
> can anyone tell me how to find all parents having the
> same child? 

DNA testing?  Ha, ha.

Seriously, it depends what you mean by "the same child."
If you mean there is just one child node and you want
to find all its parents, use select=".." (or ="parent::*").
Of course you will never get more than one node as
the answer because no node has more than one parent.

If you mean all nodes that have a child whose text value
is the same as a given value, use
  select="//*[*[. = $value]]"

If you mean all nodes that have a child whose name
is the same as a given value, use
  select="//*[*[local-name(.) = $value]]"


> An example would really help me.

It would really help me too!

Lars


 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread