Wednesday, October 31, 2007

Reading XML Document in .Net

There are 3 preferable ways to read XML document.

  • XMLDocument Class - It allows to insert, update, delete or move a node.
  • XMLTextReader Class - It allows read data in fast forward-only manner.
  • XMLValidatingReader Class - It allows to validate XML document against Document Type Definition (DTD), XML Schema definition(XSD) and XML Data Reduced(XDR).

XMLTextReader and XMLValidatingReader Class is derived from XMLReader class which provides
  • fast,
  • non-cacheable,
  • read-only, and
  • forward-only access to XML data.

Choosing between XMLDocument, XMLTextReader and XMLValidatingReader Class.
  • Use XMLDocument when
    • You want to perform operation like Insert, Update and delete.
    • Memory is not a constraint
  • Use XMLTextReader when
    • You want to read data in forward-only manner.
    • When memory is constraint.
  • Use XMLValidatingReader when
    • You want to validate XML document against DTD, XSD and XDR.

No comments:

Most Recent Post

Community Updates

Subscribe Blog via Email

Enter your email address:

Disclaimers:We have tried hard to provide accurate information, as a user, you agree that you bear sole responsibility for your own decisions to use any programs, documents, source code, tips, articles or any other information provided on this Blog.
Page copy protected against web site content infringement by Copyscape