How to choose a class for reading and/or writing XML

(taken from http://msdn2.microsoft.com/en-us/library/ms998559.aspx)

 

 

Choose the Appropriate XML Class for the Job

To help you choose the appropriate .NET Framework class to process XML, consider the following guidelines:

·         Use XmlTextReader to process XML data quickly in a forward, read-only manner without using validation, XPath, and XSLT services.

·         Use XmlValidatingReader to process and to validate XML data. Process and validate the XML data in a forward, read-only manner according to an XML schema or a DTD.

·         Use XPathNavigator to obtain read-only, random access to XML data and to use XPath queries. To create an XPathNavigator object over an XML document, you must call the XPathDocument.CreateNavigator method.

·         Use XmlTextWriter to write XML documents. You cannot use XmlTextWriter to update XML documents.

·         Use the XmlTextReader and XmlTextWriter, in combination, for simple transformations rather than resorting to loading an XmlDocument or using XSLT. For example, updating all the price element values in a document can be achieved by reading with the XmlTextReader, updating the value and then writing to the XmlTextWriter, typically by using the WriteNode method.

·         Use the XmlDocument class to update existing XML documents, or to perform XPath queries and updates in combination. To use XPath queries on the XmlDocument, use the Select method.

·         If possible, use client-side XML processing to improve performance and to reduce bandwidth.

  • Share This Post:
  • Share on Twitter
  • Share on Facebook
  • Share on Technorati
posted @ Monday, March 12, 2007 1:23 AM
Print

Comments on this entry:

# re: How to choose a class for reading and/or writing XML

Left by web development company at 8/13/2009 8:14 PM
Gravatar
Nice post,

good thing about this post is, it is not too long and it's easy to read i'm fed up with MSDN website, there for I appriciate your effort to write it

Thanks for writing about it

# to web development company

Left by Angel Eyes at 8/13/2009 10:28 PM
Gravatar
Thank you, I feel the same way about MSDN. I usually Google for articles outside MSDN for an overview and general understanding, before diving into the boring and sometimes hard to read stuff on MSDN.

# re: How to choose a class for reading and/or writing XML

Left by hırdavat at 3/27/2011 3:16 AM
Gravatar
thanks work

# re: How to choose a class for reading and/or writing XML

Left by AngelEyes at 3/27/2011 11:13 AM
Gravatar
Sure thing

# re: How to choose a class for reading and/or writing XML

Left by web tasarim at 6/27/2011 11:51 PM
Gravatar
I really liked these trends as a web designer. shares are beautiful. We expect shares More

# re: How to choose a class for reading and/or writing XML

Left by cilingir at 11/12/2011 10:48 AM
Gravatar
Waiting for more beautiful designs. I really liked these trends as a web designer.

Your comment:



(not displayed)


 
 
 
 
 

Live Comment Preview:

 
«February»
SunMonTueWedThuFriSat
2930311234
567891011
12131415161718
19202122232425
26272829123
45678910