Re: Need advice on XML usage

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Hans Kesting (news.2.hansdk_at_spamgourmet.com)
Date: 07/23/04


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
> >
>



Relevant Pages

  • Re: Using XMLDocument - a newbie question
    ... the first node you have is the XmlDocument node itself. ... Then you can apply the methods SelectNodes and SelectSingleNode with XPath 1.0 expressions e.g. ... If you want to process an XML document node by node in a forwards only mode then you don't need a System.Xml.XmlDocument, instead you use an XmlReader and call its various Read methods. ... So learning XPath 1.0 certainly is a good idea if you want to become a power user of .NET's DOM implementation. ...
    (microsoft.public.dotnet.xml)
  • Re: Accessing a node attribute XML VB6 Visual Basic 6
    ... I don't understand what you mean by "assign multiple elements to a single node". ... Does not each element in your xml represent a node in the treeview? ... Dim xmlDoc As DOMDocument30 ...
    (microsoft.public.vb.controls)
  • ANNOUNCING: MSDN Forums for .NET and XML
    ... You can now discuss issues regarding processing of XML, ... online discussion forum located at: ... - Ability to edit your question after you have posted it. ... - Tracking the items you've already read in a way that roams with you rather ...
    (microsoft.public.dotnet.xml)
  • Re: Why choose SQL Express over Access?
    ... I am thinking of coding a data store that many store locations will use to ... get national sales averages. ... Each location sends in its data in in XML ... Ability to do asynch apps ...
    (microsoft.public.dotnet.framework.adonet)
  • xml + xmlreader + xmlwrite ?
    ... I'm supposed to write a class to do search into an XML ... also capturing attribute information & elements + ability to modify ...
    (microsoft.public.dotnet.languages.csharp)