Reputation: 25799
I'm writing an XML document based on a stream of data. This part has been accomplished using the XmlTextWriter
and the XElement
classes.
Now when I come to read in the document I want to be able to 'delay-load' the XML document so that certain nodes are skipped (i.e. the ones which contain large binary chunks.) and then load them when required.
Is this possible using the XmlDocument
class? Or will I have to do things in a more manual way using the XmlTextReader
class.
Thanks.
Nick.
Upvotes: 1
Views: 192
Reputation: 3777
note that if you want to use XmlTextReader, it is fwd only. i.e. once youhave skipped it, you cant come back to it.
Upvotes: 0
Reputation: 174329
This is not possible with either XmlDocument
or XDocument
.
Upvotes: 0
Reputation: 81660
Not possible with XmlDocument
as the whole document needs to be loaded onto memory before parsed as tree.
XmlTextReader/SAX is the standard solution.
Upvotes: 3