xsl-list
[Top] [All Lists]

RE: Traversing to a parent node...

2003-10-17 04:04:53
You actually want an ancestor rather than a parent.

Specifically, you want ancestor::*[last()-1]

Michael Kay

-----Original Message-----
From: owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com 
[mailto:owner-xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com] On Behalf Of 
Karl J. Stubsjoen
Sent: 16 October 2003 22:26
To: xsl-list(_at_)lists(_dot_)mulberrytech(_dot_)com
Subject: [xsl] Traversing to a parent node...


Hello,
I need help traversing to a specifi parent node.  The result 
should always be the same parent node no matter where you are 
at in the document.  Let me
illustrate:

<AAA>
    <BBB>
            <S/>
            <T/>
            </U>
    </BBB>
            <X/>
            <Y>
                <1/>
                <2/>
                <3/>
            <Z/>
    <CCC>
            <MY>
                <DOG/>
                <AND/>
                <CAT/>
            </MY
    </CCC>
    <DDD>
    </DDD>
</AAA>


These specific parent nodes would always resolve to the node 
1 below the document element, so <BBB> or <CCC> or <DDD>.  
How is this possible?

Thanks, Karl


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



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



<Prev in Thread] Current Thread [Next in Thread>