Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Owen Hope 119 posts 140 karma points
    Oct 11, 2011 @ 20:52
    Owen Hope
    0

    Get Parents Siblings XSLT

    Hi,

    I am trying to get the parent nodes siblings in XSLT and having some difficulty.

    Here is my structure:

    A

           a

    B

    C

     

    From 'a' I want to select 'A' 'B' and 'C'

    Thanks

    Owen

  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    Oct 11, 2011 @ 21:03
    Chriztian Steinmeier
    1

    Hi Owen,

    Just jump up two steps and take the (document) children:

    <xsl:variable name="parentAndSiblings" select="$currentPage/../../*[@isDoc]" />

    /Chriztian

    PS: If Axes confuse you, take a look at the Axes Visualizer

  • Owen Hope 119 posts 140 karma points
    Oct 11, 2011 @ 21:05
    Owen Hope
    0

    Thanks again Chriztian ! Hero!

  • Rodion Novoselov 694 posts 859 karma points
    Oct 11, 2011 @ 21:06
    Rodion Novoselov
    0

    Hi,

    <xsl:for-each select="$a/../../*">
       bla-bla-bla 

    '$a' is of course supposed to contain your 'a' node.

Please Sign in or register to post replies

Write your reply to:

Draft