开发者

Delay-load of XmlDocument

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 manu开发者_Python百科al way using the XmlTextReader class.

Thanks.

Nick.


Not possible with XmlDocument as the whole document needs to be loaded onto memory before parsed as tree.

XmlTextReader/SAX is the standard solution.


This is not possible with either XmlDocument or XDocument.


note that if you want to use XmlTextReader, it is fwd only. i.e. once youhave skipped it, you cant come back to it.

see MSDN on this

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜