Copied to clipboard

Flag this post as spam?

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


  • MK 429 posts 905 karma points
    Jan 03, 2013 @ 11:34
    MK
    0

    MNTP - xpath expression get 2 nodes

     

    Hi there,

    Im using the following xpath to select node with specific alias:

    $currentPage/ancestor::*[@level = 1]//  NewsandMediaContainer 

    is it possible to get 2 nodes with 2 different alias?

    Regards'

    mkariti

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Jan 03, 2013 @ 11:37
    Lee Kelleher
    0

    Hi mkariti,

    Sure, you can use XPath's "name()" function to check the names:

    $currentPage/ancestor::*[@level = 1]//*[@isDoc and ( name() = 'NewsandMediaContainer' or name() = 'SomethingElse' )]

    Cheers, Lee.

  • MK 429 posts 905 karma points
    Jan 03, 2013 @ 11:49
    MK
    0

    Hi Lee,

     

    Many thanks for your reply.

    The above code gets the first node only rather than both.

    Any ides?

    Cheers

    mkariti

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Jan 03, 2013 @ 11:51
    Lee Kelleher
    100

    Ah ok, sorry - this is for the Start Node?  Unfortuately there can only be a single start node.

  • MK 429 posts 905 karma points
    Jan 03, 2013 @ 12:01
    MK
    0

    Ok Many thanks.

     

Please Sign in or register to post replies

Write your reply to:

Draft