[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Hierarchy problem
Dave, David C made a typo when he wrote: >> just if $y is a child of $x which is what I think you mean by direct >> descendant. >> >> count($x//*|$y) = count($x/*) >> >> if $y is a descendent of $x He meant: count($x//*|$y) = count($x//*) ^ additional / In other words, count the number of nodes in the union of the descendant elements of $x with $y and see if it's the same as the number of *descendant* elements of $x. As it was, it was testing $x's *children* against the union. Try that. I think you'll find that it works (returns true if $y is a descendant of $x). Cheers, Jeni --- Jeni Tennison http://www.jenitennison.com/ XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|