Geeks With Blogs

News
AngelEyes on .Net Tips, tricks and WTFs about Asp .Net, SQL Server and the likes.

(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.


Update: (not from MSDN)

Please note a slight problem with XML serialization encoding at http://stackoverflow.com/q/5975020/532517 

Posted on Monday, March 12, 2007 1:23 AM | Back to top


Comments on this post: How to choose a class for reading and/or writing XML

# re: How to choose a class for reading and/or writing XML
Requesting 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
Left by web development company on Aug 13, 2009 8:14 PM

# to web development company
Requesting 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.
Left by Angel Eyes on Aug 13, 2009 10:28 PM

# re: How to choose a class for reading and/or writing XML
Requesting Gravatar...
thanks work
Left by hırdavat on Mar 27, 2011 3:16 AM

# re: How to choose a class for reading and/or writing XML
Requesting Gravatar...
Sure thing
Left by AngelEyes on Mar 27, 2011 11:13 AM

# re: How to choose a class for reading and/or writing XML
Requesting Gravatar...
I really liked these trends as a web designer. shares are beautiful. We expect shares More
Left by web tasarim on Jun 27, 2011 11:51 PM

# re: How to choose a class for reading and/or writing XML
Requesting Gravatar...
Waiting for more beautiful designs. I really liked these trends as a web designer.
Left by cilingir on Nov 12, 2011 10:48 AM

Your comment:
 (will show your gravatar)


Copyright © AngelEyes | Powered by: GeeksWithBlogs.net