Why am I not able to start using XPath for XML?
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Why am I not able to start using XPath for XML?

  1. #1
    Join Date
    Sep 2009
    Posts
    7

    Why am I not able to start using XPath for XML?

    Here is my screen
    http://www.upload3r.com/serve/110810/1281559660.jpg


    Am I doing something wrong?

    I am.... so what is it?



    I've included Xpath. In my references (2 kinds of references I think there are, and I included this this w/e-ness in both.)

    I try to make an object and it's not recognizing the class...



    BTW, it's not like my job depends on this or anything, I'm just saying I might go insane if I don't get this to work. This C Sharp business is pushing me over the edge, I have no idea why it's so hard to get these things to connect.



    And yes, my job does depend on it.





    I was going to use this XPath example, but I can't even get passed this reference error. Why is my life failing so hard? Why am I failing so hard? http://www.codeproject.com/KB/cpp/myXPath.aspx

    Is there a way to get XML from a string and NOT a document?

  2. #2
    Join Date
    Sep 2008
    Location
    Netherlands
    Posts
    865

    Re: Why am I not able to start using XPath for XML?

    Is there a way to get XML from a string and NOT a document?
    You can use the default XmlDocument class that .NET offers you.
    Code:
    System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
    doc.LoadXml("my XML text");
    I've included Xpath
    Also XPath is default included in .NET. Using the same XmlDocument class:
    Code:
    System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
    ...
    var nodeList = doc.SelectNodes("my Xpath expression");

  3. #3
    Arjay's Avatar
    Arjay is offline Moderator / MS MVP Power Poster
    Join Date
    Aug 2004
    Posts
    11,197

    Re: Why am I not able to start using XPath for XML?

    You need to add the reference to your project. The Add Reference dialog Recent tab that is in your screen shot doesn't mean those references have been added to your project - those are only references that have been used recently.

    To see which references are in your project, open the Solution Explorer and expland the 'References' node.
    Attached Images Attached Images  

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Azure Activities Information Page

Windows Mobile Development Center


Click Here to Expand Forum to Full Width

This is a CodeGuru survey question.


Featured


HTML5 Development Center