sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
Earl Teigrob's Avatar

How to seach and read XML node


Question posted by: Earl Teigrob (Guest) on November 11th, 2005 10:50 PM
I am somewhat new to working with the base XML classes and have always
worked throught a DataSet before. Now I just need to retieve one piece of
info from an XML file and think that using one of the XMLReader based
classes would be [much] faster then reading the entire file into a DataSet
the then seaching the DataSet.

In the following XML file, I would like to search for name="Joe" and
retrieve the string of roles for Joe. What class would be best for for this
and where can I get an example of code to do this?

<userinfo>
<name>Joe</name>
<roles>Admin</roles>
</userinfo>
<userinfo>
<name>Sue</name>
<roles>Operator</roles>
</userinfo>

Thanks

Earl


1 Answer Posted
Earl Teigrob's Avatar
Guest - n/a Posts
#2: Re: How to seach and read XML node

I got it...


"Earl Teigrob" <earlt777@hotmail.com> wrote in message
news:uUYKo0UUDHA.2512@TK2MSFTNGP10.phx.gbl...[color=blue]
> I am somewhat new to working with the base XML classes and have always
> worked throught a DataSet before. Now I just need to retieve one piece of
> info from an XML file and think that using one of the XMLReader based
> classes would be [much] faster then reading the entire file into a DataSet
> the then seaching the DataSet.
>
> In the following XML file, I would like to search for name="Joe" and
> retrieve the string of roles for Joe. What class would be best for for[/color]
this[color=blue]
> and where can I get an example of code to do this?
>
> <userinfo>
> <name>Joe</name>
> <roles>Admin</roles>
> </userinfo>
> <userinfo>
> <name>Sue</name>
> <roles>Operator</roles>
> </userinfo>
>
> Thanks
>
> Earl
>
>[/color]


 
Not the answer you were looking for? Post your question . . .
196,836 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 196,836 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors