Copied to clipboard

Flag this post as spam?

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


  • Michael Falch Madsen 70 posts 92 karma points
    Apr 13, 2011 @ 20:45
    Michael Falch Madsen
    0

    ancestor-or-self until certain level

    How would i write xslt to select all nodes with property bottomMenu set?

     

    My tree looks like this

    Content
      -- Site1
        -- language1
          -- Node with property bottomMenu=1
          -- Node
            -- Node with property bottomMenu=1
         -- Node
    -- Site2
        -- language2
          -- Node with property bottomMenu=1
          -- Node
            -- Node with property bottomMenu=1
         -- Node

     

    Now i have

    $currentPage/ancestor-or-self::root//* [@isDoc and bottomMenu = 1]

    but it gives me pages from all lanugages

  • Tom Fulton 2030 posts 4998 karma points c-trib
    Apr 13, 2011 @ 20:49
    Tom Fulton
    1

    Instead of root, try specifying your level there:

    $currentPage/ancestor-or-self::* [@level=2]//* [@isDoc and bottomMenu = 1]

    -Tom

  • Michael Falch Madsen 70 posts 92 karma points
    Apr 13, 2011 @ 20:55
    Michael Falch Madsen
    0

    Works perfectly :) Thanks a million!!!!!!

Please Sign in or register to post replies

Write your reply to:

Draft