XML Documents and Data
The .NET Framework provides a comprehensive and integrated set of classes that enable you to build XML-aware apps easily. The classes in the following namespaces support parsing and writing XML, editing XML data in memory, data validation, and XSLT transformation.
For a full list, see the System.Xml Namespaces webpage.
The classes in these namespaces support World Wide Web Consortium (W3C) recommendations. For example:
The XML classes in the .NET Framework provide these benefits:
Productivity. LINQ to XML makes it easier to program with XML and provides a query experience that is similar to SQL.
Extensibility. The XML classes in the .NET Framework are extensible through the use of abstract base classes and virtual methods. For example, you can create a derived class of the XmlUrlResolver class that stores the cache stream to the local disk.
Pluggable architecture. The .NET Framework provides an architecture in which components can utilize one another, and data can be streamed between components. For example, a data store, such as an XPathDocument or XmlDocument object, can be transformed with the XslCompiledTransform class, and the output can then be streamed either into another store or returned as a stream from a web service.
Performance. For better app performance, some of the XML classes in the .NET Framework support a streaming-based model with the following characteristics:
Minimal caching for forward-only, pull-model parsing (XmlReader).
Forward-only validation (XmlReader).
Cursor style navigation that minimizes node creation to a single virtual node while providing random access to the document (XPathNavigator).
For better performance whenever XSLT processing is required, you can use the XPathDocument class, which is an optimized, read-only store for XPath queries designed to work efficiently with the XslCompiledTransform class.
Integration with ADO.NET. The XML classes and ADO.NET are tightly integrated to bring together relational data and XML. The DataSet class is an in-memory cache of data retrieved from a database. The DataSet class has the ability to read and write XML by using the XmlReader and XmlWriter classes, to persist its internal relational schema structure as XML schemas (XSD), and to infer the schema structure of an XML document.
In This Section
XML Processing Options
Discusses options for processing XML data.
Processing XML Data In-Memory
Discusses the three models for processing XML data in-memory. LINQ to XML, the XmlDocument class (based on the W3C Document Object Model), and the XPathDocument class (based on the XPath data model).
Describes how to use the XSLT processor.
XML Integration with Relational Data and ADO.NET
Describes how the .NET Framework enables real-time, synchronous access to both the relational and hierarchical representations of data through the DataSet object and the XmlDataDocument object.
Provides information on how to access data using ADO.NET.
Provides an overview of the .NET Framework security system.
We'd love to hear your thoughts. Choose the type you'd like to provide:
Our feedback system is built on GitHub Issues. Read more on our blog.