Copied to clipboard

Flag this post as spam?

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


  • Gerrie Pretorius 4 posts 85 karma points
    Jan 09, 2016 @ 15:59
    Gerrie Pretorius
    0

    Xpath Expression Filter - Why cant i see any nodes? iD10T error

    Hi

    I am new to xpath. I am trying to use the "nuPickers XML Dropdown picker" on Umbraco 7.3.4

    but no matter what xpath xpression filter i use, the dropdown remains empty no nodes is being loaded in to the dropdown

    i tried the following filters:

    $root/

    $site/

    /*/

    $ancestor-or-self::Home/

    but to no avail, none of them loads any nodes

    i actually want to select all the "Club" nodes under "Clubcontainer", but i cant get it to load any nodes, nevermind the specific ones that i actually want. My Umbraco.config looks as follows: (some nodes removed under to only show relevant nodes for my filter query.)

    <root id="-1">
      <Home id="2081" key="ebb9222f-f26c-4462-9f5d-43dba520326f" parentID="-1" level="1" creatorID="0" sortOrder="0" createDate="2015-12-29T12:19:53" updateDate="2016-01-09T17:27:57" nodeName="Home" urlName="home" path="-1,2081" isDoc="" nodeType="1070" creatorName="Gerrie Pretorius" writerName="Gerrie Pretorius" writerID="0" template="1049" nodeTypeAlias="Home">
        <Clubcontainer id="2094" key="6f11e986-3e29-4555-8bc4-5a847600704c" parentID="2081" level="2" creatorID="0" sortOrder="3" createDate="2015-12-29T13:20:15" updateDate="2016-01-09T17:27:57" nodeName="Chess Clubs" urlName="chess-clubs" path="-1,2081,2094" isDoc="" nodeType="2092" creatorName="Gerrie Pretorius" writerName="Gerrie Pretorius" writerID="0" template="0" nodeTypeAlias="Clubcontainer">
          <Club id="2103" key="856c9937-cf4c-481b-aaba-487e0dcee199" parentID="2094" level="3" creatorID="0" sortOrder="0" createDate="2016-01-07T22:41:28" updateDate="2016-01-09T17:27:57" nodeName="Hlalefang Alexandra Chess club" urlName="hlalefang-alexandra-chess-club" path="-1,2081,2094,2103" isDoc="" nodeType="2093" creatorName="Gerrie Pretorius" writerName="Gerrie Pretorius" writerID="0" template="0" nodeTypeAlias="Club">
            <president><![CDATA[Mr President]]></president>
            <presidentCell><![CDATA[0123 13131313]]></presidentCell>
            <presidentEmail><![CDATA[johnDoe@nowhere.com]]></presidentEmail>
          </Club>
          <Club id="2104" key="a5d73286-9572-445b-9d3a-7f758de64d0e" parentID="2094" level="3" creatorID="0" sortOrder="1" createDate="2016-01-07T22:42:27" updateDate="2016-01-09T17:27:57" nodeName="Chess Excellence" urlName="chess-excellence" path="-1,2081,2094,2104" isDoc="" nodeType="2093" creatorName="Gerrie Pretorius" writerName="Gerrie Pretorius" writerID="0" template="0" nodeTypeAlias="Club">
            <president><![CDATA[Jane Doe]]></president>
            <presidentCell><![CDATA[012 345 6789]]></presidentCell>
            <webAddress><![CDATA[http://www.mydomain.com]]></webAddress>
            <presidentEmail><![CDATA[janedoe@nowhere.com]]></presidentEmail>
          </Club>
        </Clubcontainer>
      </Home>
    </root>
    

    If some-one can help me witht his i would greatly appreciate it.

  • Marc Goodson 2157 posts 14435 karma points MVP 9x c-trib
    Jan 10, 2016 @ 11:36
    Marc Goodson
    101

    Hi Gerrie

    Some pretty good examples of how the Xpath can be written here:

    https://github.com/uComponents/nuPickers/wiki/Data-Source-Xml

    so

    //Club 
    

    would return 'all' club nodes in your site.

    and I think...

    $ancestorOrSelf/ancestor-or-self::Home[position()=1]//Clubcontainer//Club
    

    would be close to what you are after...

  • Gerrie Pretorius 4 posts 85 karma points
    Jan 11, 2016 @ 20:20
    Gerrie Pretorius
    0

    thank you very much! you are my Hero!

  • 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