• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 2572
  • Last Modified:

C#: Searching an XML file using XPath

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
pixarksa
Asked:
pixarksa
1 Solution
 
Kamaraj SubramanianApplication Support AnalystCommented:
here is the program you need

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

register in this site and download a source code
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Upgrade your Question Security!

Your question, your audience. Choose who sees your identity—and your question—with question security.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now