C#: Searching an XML file using XPath

Posted on 2009-02-14
Last Modified: 2013-12-14

I have an XML file that is loaded into a Windows CE device. I created a C# application for smart devices and loaded that file info XmlDocument object.

I need to search in that file for a specific ID and return the complete node.

I need a function that I pass the ID and it return title and desc values. I assume that using xPath is the ideal solution. if not, please feel free to solve this issue in the best way you can.

<?xml version="1.0"?>




        <title>some title 1</title>

        <desc>this is a description 1</desc>




        <title>some title 2</title>

        <desc>this is a description 2</desc>




        <title>some title 3</title>

        <desc>this is a description 3</desc>



Open in new window

Question by:pixarksa
    1 Comment
    LVL 23

    Accepted Solution

    here is the program you need

    register in this site and download a source code

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    Suggested Solutions

    Programmer's Notepad is, one of the best free text editing tools available, simply because the developers appear to have second-guessed every weird problem or issue a programmer is likely to run into. One of these problems is selecting and deleti…
    Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project ( automates most of the tasks discussed in this article. You can even fin…
    The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
    The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

    728 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    17 Experts available now in Live!

    Get 1:1 Help Now