Re: Need advice on XML usage
From: Hans Kesting (news.2.hansdk_at_spamgourmet.com)
Date: 07/23/04
- Next message: Dmitriy Lapshin [C# / .NET MVP]: "Re: Another Problem ... but Namespace \root\cimv2."
- Previous message: Shiva: "Re: Information"
- In reply to: Amadej: "Re: Need advice on XML usage"
- Next in thread: Amadej: "Re: Need advice on XML usage"
- Reply: Amadej: "Re: Need advice on XML usage"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 23 Jul 2004 13:36:13 +0200
"Amadej" <Amadej_nospam_@leoss.si> wrote in message news:6bl1g0pgf7t8ragbgqcidgc8lhjb4jmcg4@4ax.com...
> That was what I originally tried, but after I get the node I lost the
> ability to select a single node from that node (to extract the name
> element only, for instance), and it seemed to be a bit of a overhead
> to write code with correct error checking and moving trough all the
> child nodes just for 3 elements.
>
> From what I have tried now, I must admit I preferre working with
> ADO.NET and reading/writing into a XML. The only thing I worry about
> is it might not be the most efficient way (resource vise) of doing it,
> seeming that this is an small (but important and frequent) task in my
> application?
>
> Amadej.
>
> On Fri, 23 Jul 2004 09:24:42 +0200, "Hans Kesting"
> <news.2.hansdk@spamgourmet.com> wrote:
> >
> >You can use XmlDocument: it has a SelectSingleNode method that
> >accepts an XPath expression and gives out the first node found.
> >(Alternative, use SelectNodes to get all that apply)
> >
> >XmlDocument xml = new XmlDocument();
> >xml.Load(theFile);
> >XmlNode myNameNode = xml.SelectSingleNode("//name");
and then:
XmlNode mySpecificNode = xml.SelectSingleNode("//" + myNameNode.InnerXml);
to find some other node, based on that first result?
or did I miss something? What will your final xml look like?
> >
> >
> >Hans Kesting
> >
>
- Next message: Dmitriy Lapshin [C# / .NET MVP]: "Re: Another Problem ... but Namespace \root\cimv2."
- Previous message: Shiva: "Re: Information"
- In reply to: Amadej: "Re: Need advice on XML usage"
- Next in thread: Amadej: "Re: Need advice on XML usage"
- Reply: Amadej: "Re: Need advice on XML usage"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|