XML (.NET 1.1) Performance Guidelines

From Guidance Share
Jump to navigationJump to search

- J.D. Meier, Srinath Vasireddy, Ashish Babbar, and Alex Mackman


Contents

  • 1 Design Considerations
  • 2 Parsing XML
  • 3 Validating XML
  • 4 Writing XML
  • 5 XSLT Processing
  • 6 XPath Queries

Design Considerations

  • Choose the appropriate XML class for the job.
  • Consider validating large documents.
  • Process large documents in chunks if possible.
  • Use streaming interfaces.
  • Consider hard-coded transformations.
  • Consider element and attribute name lengths.
  • Consider sharing the XmlNameTable.


Parsing XML

  • Use XmlTextReader to parse large XML documents.
  • Use XmlValidatingReader for validation.
  • Consider combining XmlReader and XmlDocument.
  • On the XmlReader use the MoveToContent and Skip methods to skip unwanted items.


Validating XML

  • Use XmlValidatingReader.
  • Do not validate the same document more than once.
  • Consider caching the schema.


Writing XML

  • Use XmlTextWriter


XSLT Processing

  • Use XPathDocument for faster XSLT transformations.
  • Consider caching compiled style sheets.
  • Split complex transformations into several stages.
  • Minimize the size of the output document.
  • Write efficient XSLT.


XPath Queries

  • Use XPathDocument to process XPath statements.
  • Avoid the // operator by reducing the search scope.
  • Compile both dynamic and static XPath expressions.
Retrieved from "http://guidanceshare.com/index.php?title=XML_(.NET_1.1)_Performance_Guidelines&oldid=5334"
Categories:
  • XML (.NET 1.1)
  • Guidelines

Navigation menu

Page actions

  • Article
  • Discussion
  • View source
  • History

Page actions

  • Article
  • Discussion
  • More
  • Toolbox
  • In other languages

Personal tools

  • Log in

Navigation

  • Main Page
  • Community portal
  • Current events
  • Recent changes
  • Random page
  • Help
  • Donations

Toolbox

  • What links here
  • Related changes
  • Special pages
  • Printable version
  • Permanent link
  • Page information

 
Powered by MediaWiki
  • This page was last edited on 14 December 2007, at 04:28.
  • Privacy policy
  • About Guidance Share
  • Disclaimers