Copied to clipboard

Flag this post as spam?

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


  • MK 426 posts 902 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 3945 posts 15163 karma points MVP 10x 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 426 posts 902 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 3945 posts 15163 karma points MVP 10x 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 426 posts 902 karma points
    Jan 03, 2013 @ 12:01
    MK
    0

    Ok Many thanks.

     

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies