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

Re: If Current Node Is Ancestor!

Subject: Re: If Current Node Is Ancestor!
From: omprakash.v@xxxxxxxxxxxxx
Date: Tue, 12 Apr 2005 09:23:40 +0530
if current
Hi,
        Are you particular about using the ancestor axis bcos I don't think
it is of much use here. You can do this using the descendant axis as
follows:

     <xsl:if test="descendant::menu[@dept = $dept]">
          <xsl:value-of select="'node found'"/>
     </xsl:if>


This is assuming I understood your requirement right.

Cheers,
Omprakash.V







                                                                                                                    
                    Brian Chrisman                                                                                  
                    <incubus@shell        To:     xsl-list@xxxxxxxxxxxxxxxxxxxxxx                                   
                    .izap.com>            cc:     (bcc: omprakash.v/Polaris)                                        
                                          Subject:     Re:  If Current Node Is Ancestor!                       
                    04/12/2005                                                                                      
                    09:04 AM                                                                                        
                    Please respond                                                                                  
                    to xsl-list                                                                                     
                                                                                                                    
                                                                                                                    




On Tue, Apr 12, 2005 at 01:19:41PM +1000, Adam J Knight wrote:
> Hi all,
>
> I am trying to test whether a current node is an ancestor of a menu node
> with a dept attribute equal to $depth. I appear to be struggling with
this
> conceptually and would appreciate any help!!
>
> <xsl:if test="//menu[@dept != $dept]/ancestor::menu ">
>   <xsl:attribute name="class">nav_close</xsl:attribute>
> </xsl:if>

Here's one way I *think* you could do it.. but I haven't
tried it.. and I don't use this functionality much..

<xsl:variable name="my-depth" select="count(ancestor::*)"/>
<xsl:if test=".//menu[(count(ancestor::*) - $my-depth) = $depth]">
  foo
</xsl:if>

>
> Cheers,
> Adam
> ?






This e-Mail may contain proprietary and confidential information and is sent for the intended recipient(s) only. 
If by an addressing or transmission error this mail has been misdirected to you, you are requested to delete this mail immediately.
You are also hereby notified that any use, any form of reproduction, dissemination, copying, disclosure, modification,
distribution and/or publication of this e-mail message, contents or its attachment other than by its intended recipient/s is strictly prohibited.

Visit Us at http://www.polaris.co.in

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.