Re: archival of newsfeeds?

Tech-Archive recommends: Speed Up your PC by fixing your registry



But the problem when I use xml files is that if I want to modifiy them, I
have to rewrite the entire file, right?


"Pascal Schmitt" <newsgroup@xxxxxxxx> schrieb im Newsbeitrag
news:uF8vy7IlFHA.576@xxxxxxxxxxxxxxxxxxxxxxx
> Hello!
>
>>> For best comfort, use the XPathDocument wich allows you to use XPath on
>>> streamed xml (eg. it is not loaded into memory) for even more
>>> Performance but more specific and schema-centric code use
>>> Xml(Text)Reader.
>>
>> But if I want to search within my feed is XmlDocument the right solution
>> or
>> is there a better way?
>
> XPathDocument. If there is no need to modify anything, use it!
> (and IF you need to modify a big XML file consider using XmlTextReader &
> XmlTextWriter simultaneously: read data, modify it, write it at once - not
> as nice too look at as DOM operations but really fast.)
>
> XPathDocument x = new XPathDocument("file.xml");
> int f = (int)(double)x.CreateNavigator().Evaluate("count(//foo)");
>
>
>> How fast is XPath? Does it simply walk through all nodes or are there
>> optimized algorithms used, for example hashing?
>
> Afaik there is no need for optimisation because XPath just walks the
> Document using an XPathNavigator (wich both XPathDocument and XmlDocument
> implement but XPathDocument is faster but does not allow editing data
> until .NET 2.0).
>
>
> --
> Pascal Schmitt


.



Relevant Pages

  • Re: Many concurrent users of site using XPathDocument and XslTransform objects efficiently?
    ... actually loading the doc is pretty quick, but xsl processing is very slow ... rather then caching the xml input docs. ... > Likely the greatest cost is reading the XML files ... > this on the Microsoft site concerning the XPathDocument: ...
    (microsoft.public.dotnet.framework.aspnet)
  • Many concurrent users of site using XPathDocument and XslTransform objects efficiently?
    ... Likely the greatest cost is reading the XML files into memory (the ... I was thinking about using the Singleton pattern to encapsulate a XPathDocument, ... - Overloads Public Sub Transform ... Dim xmlWriter As XmlTextWriter = New XmlTextWriter(Response.OutputStream, ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: [Newbie] Output something using XSLT even if an element is missing in some documents?
    ... contains the field name and a lot of tabs - none of the content is printed ... The root element of my XML files is "inspec" and each file contains an ... number of articles, which is next level down in the tree. ... An example XPATH is ...
    (comp.text.xml)
  • Re: [Newbie] Output something using XSLT even if an element is missing in some documents?
    ... After fixing this the tranformation now runs. ... contains the field name and a lot of tabs - none of the content is printed ... The root element of my XML files is "inspec" and each file contains an ... An example XPATH is ...
    (comp.text.xml)
  • Insering a node via an expression
    ... I am creating a simple CRUD application which uses xml files as data storage. ... I extended Textbox with a XPath expression and a XmlDocument property, this way I can easily read and update existing nodes' content. ... If my XmlDocument had a schema it would be somehow possible to construct a prototype xml fragment that I could insert in the right spot, but this in interaction with XPath goes way beyond my programming skills. ...
    (microsoft.public.dotnet.xml)