Copied to clipboard

Flag this post as spam?

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


  • teus 42 posts 74 karma points
    Nov 04, 2011 @ 09:22
    teus
    0

    GetNodeByXpath cannot get it to work.

    umbraco v 4.6.1 (Assembly version: 1.0.4029.25836)

    In a usercontrol I'm trying to load a node on the basis of a urlname path.

    By using http://our.umbraco.org/projects/developer-tools/umbraco-xpath-evaluator I checked that 

    the query /root/*[@urlName="homepage"]/*[@urlName="contact""]/*[@urlName="mailform"]   works ; it returns 1 node.

    But if i run it in GetNodeByXpath it returns an empty node

    string Qury = @"/root/*[@urlName=""homepage""]/* [@urlName=""contact""]/CWS_Contact[@urlName=""mailform""]";

      Node thenode = Node.GetNodeByXpath(Qury);

    Even if I try  Node.GetNodeByXpath("//CWS_Contact[@id='3126']");

    it returns null
    Am I missing something ? Is it meant to be used like this ? I als can't find any documentation or examples.

Please Sign in or register to post replies

Write your reply to:

Draft