[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

C#: Searching an XML file using XPath

Posted on 2009-02-14
1
Medium Priority
?
2,570 Views
Last Modified: 2013-12-14
Hi,

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.

regards
<?xml version="1.0"?>
<data>
    <record>
        <id>1</id>
        <title>some title 1</title>
        <desc>this is a description 1</desc>
    </record>
    <record>
        <id>2</id>
        <title>some title 2</title>
        <desc>this is a description 2</desc>
    </record>
    <record>
        <id>3</id>
        <title>some title 3</title>
        <desc>this is a description 3</desc>
    </record>
</data>

Open in new window

0
Comment
Question by:pixarksa
1 Comment
 
LVL 23

Accepted Solution

by:
Kamaraj Subramanian earned 500 total points
ID: 23641508
here is the program you need

http://www.codeproject.com/KB/cpp/myXPath.aspx

register in this site and download a source code
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In our object-oriented world the class is a minimal unit, a brick for constructing our applications. It is an abstraction and we know well how to use it. In well-designed software we are not usually interested in knowing how objects look in memory. …
How to install Selenium IDE and loops for quick automated testing. Get Selenium IDE from http://seleniumhq.org Go to that link and select download selenium in the right hand column That will then direct you to their download page. From that p…
The viewer will learn how to use and create keystrokes in Netbeans IDE 8.0 for Windows.
The viewer will learn how to synchronize PHP projects with a remote server in NetBeans IDE 8.0 for Windows.

830 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