Copied to clipboard

Flag this post as spam?

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


  • Emanuel 6 posts 76 karma points
    Feb 16, 2016 @ 07:31
    Emanuel
    0

    XPath working on Razor but not on Multinode Picker

    My xpath query does not work when used with multimode picker but works when used like Umbraco.GetContentAtXPath in Razor. It also works if I execute the query on a visualizer tool like XPathPizualizerTool

    Below is the query and the content.

    Query:

    //TeamMembers[TeamMember[categoriesMainSite[contains(text(),"Blog Authors")]]]
    

    Content:

    <TeamMembers id="..." key="..." parentID="..." level="2" creatorID="0" sortOrder="7" createDate="2016-02-15T16:36:20" updateDate="2016-02-15T16:36:20" nodeName="Team Members" urlName="team-members" path="-1,1239,1325" isDoc="" nodeType="1175" creatorName="Virca" writerName="Virca" writerID="0" template="1174" nodeTypeAlias="TeamMembers">
          <showSponsors>0</showSponsors>
          <TeamMember id="1330" key="e1d7bd14-6aa7-4a44-ac01-27e20b6315a7" parentID="1325" level="3" creatorID="0" sortOrder="0" createDate="2016-02-16T08:42:08" updateDate="2016-02-16T08:42:08" nodeName="Lazau Florin-Ionel" urlName="lazau-florin-ionel" path="-1,1239,1325,1330" isDoc="" nodeType="1173" creatorName="Emanuel Virca" writerName="Emanuel Virca" writerID="0" template="1172" nodeTypeAlias="TeamMember">
            <firstName><![CDATA[Florin-Ionel]]></firstName>
            <lastName><![CDATA[Lazau]]></lastName>
            <categoriesMainSite><![CDATA[Blog Authors]]></categoriesMainSite>
          </TeamMember>
          <TeamMember id="1331" key="4c385076-5025-44e0-8440-35be66306184" parentID="1325" level="3" creatorID="0" sortOrder="1" createDate="2016-02-16T08:42:36" updateDate="2016-02-16T08:42:36" nodeName="Virca Emanuel" urlName="virca-emanuel" path="-1,1239,1325,1331" isDoc="" nodeType="1173" creatorName="Emanuel Virca" writerName="Emanuel Virca" writerID="0" template="1172" nodeTypeAlias="TeamMember">
            <firstName><![CDATA[Virca]]></firstName>
            <lastName><![CDATA[Emanuel]]></lastName>
            <categoriesMainSite><![CDATA[National Advisory Board,Staff,Board of Directors,Chapter Board Members,Leadership Council,Trainers]]></categoriesMainSite>
          </TeamMember>
        </TeamMembers>
    

    The query does not take into consideration the contains function of the query and always returns all the members.

    Any Help Please?

  • Hendy Racher 863 posts 3849 karma points MVP 2x admin c-trib
    Feb 16, 2016 @ 08:03
    Hendy Racher
    1

    Hi Emanuel,

    The Multinode Tree Picker uses XPath to find a start node, rather than nodes to use as options - as an alternative you could use any of the Xml Pickers in nuPickers.

    HTH, Hendy

Please Sign in or register to post replies

Write your reply to:

Draft