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

Re: Hierarchy problem

Subject: Re: Hierarchy problem
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Fri, 19 Jul 2002 10:17:21 -0700 (PDT)
kimball hierarchy
--- DPawson at rnib dot org dot uk wrote:

> 
> With a structure such as
> 
> 
> <bodymatter>
>   <level1 id='l1'>
>    <h1>Level1</h1>
>    <level2 id='l2'>
>     <h2>Level2</h2>  <!-- bad navPoint 1 -->
>     <level3 id='l3'> <!-- good navPoint 2 -->
>      <h3>level3</h3>
>      <note id="noteId">  <!-- navLabel target -->
>       <p>Note content</p>
>      </note>
>     </level3>
>    </level2>
>   </level1>
> 
> ....
> 
> I need to check that the node with id=noteId
> is (or is not) a direct descendant of another node (e.g.
> level2[id='l2'])
> or if there are intervening levelX elements.
> 

Hi Dave,

The following XPath expression will return the direct ancestor of the
"note" element that is a "level2" element, or nothing, if the "note"
element does not have a "level2" direct ancestor:

$vNote/ancestor::*[starts-with(name(), 'level')][1][self::level2]

Do I understand correctly that by "direct ancestor" you mean the first
ancestor, whose name is levelX?



=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL

__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com

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


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.