Copied to clipboard

Flag this post as spam?

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


  • Connie DeCinko 931 posts 1160 karma points
    May 19, 2011 @ 23:57
    Connie DeCinko
    0

    XPath Expression for nodes starting at specific node

    I'm trying to set up a uComponents XPath CheckBoxList.  I want my XPath filter to only show content from a certain starting node.  How do I do that?  umbraco.library:GetXmlNodeById won't work here.

     

  • Lee Kelleher 4026 posts 15836 karma points MVP 13x admin c-trib
    May 20, 2011 @ 00:36
    Lee Kelleher
    0

    Hi Connie,

    The XPath expression used in uComponents (which the same for the XPath Checkbox/Dropdown and MultiNodeTreePicker) does not load in any XSLT extensions (e.g. "umbraco.library", etc).  It performs a straight XPath query the XML cache, (from the root node).

    If you wanted to use "GetXmlNodeById", try the following XPath...

    //*[@isDoc and @id = '1234']

    Cheers, Lee.

  • Connie DeCinko 931 posts 1160 karma points
    May 20, 2011 @ 01:13
    Connie DeCinko
    1

    Since I wanted all below a certain node, I went with this, which seems to work and hopefully is good form.

    //*[@id=1227]/* [@isDoc]
  • Chriztian Steinmeier 2800 posts 8790 karma points MVP 8x admin c-trib
    May 20, 2011 @ 12:59
    Chriztian Steinmeier
    1

    Hi Connie,

    It's good form allright, only way to optimize that is if you know the exact path to the node (and only necessary if you have a LOT of nodes in the solution), e.g.:

    /root/Website[@nodeName = 'English Site']/Textpage[1]/Textpage[@id = 1227]/*[@isDoc]

    /Chriztian

Please Sign in or register to post replies

Write your reply to:

Draft