Skip to main content

Learning XML - Overview

XML is an almost universally supported way of exchanging documents and data across applications and platforms. Microsoft was a pioneer in XML development and takes pride in the quality, performance, and standards conformance of our XML technologies. We have a family of XML technologies that allows users with differing requirements to do what they need, as simply and efficiently as possible.

Which XML application programming interface (API) should you use? Here are our top-level guidelines:

  • If you are writing managed code targeting the .NET Framework in C#, Visual Basic, J#, managed C++, or any other managed language, you should use System.Xml and/or LINQ to XML in the .NET Framework.
  • If you are writing native code using Visual Basic 6, C, C++, or a scripting languages you will probably want to use the MSXML library:
    • MSXML6 is the latest version that's included with Windows XP SP3 and all versions of Windows Vista and Windows 7. New applications should be using MSXML6.
    • MSXML5 is an older library optimized for Microsoft Office 2003 and 2007 and can only be used on machines that have an Office license.
    • MSXML4 is nearing deprecation. MSXML6 should be used for new applications
    • MSXML3 is included in Windows XP and higher.
    • Comprehensive list of all MSXML versions and variants
  • If you are writing native code and your application has tight performance or memory constraints, consider the XmlLite API.

What XML Tools Are Available? Visual Studio offers a core collection:

Understanding XML Fundamentals

Using Inline Schemas
Inline schemas are XML schema definitions included inside XML instance documents. Like external schema documents, inline schemas can be used to validate that the instance matches the schema constraints.

Understanding Infosets
Covers the most important types of information items and their properties, the mapping between Infoset properties and the serialization format defined by the XML 1.0 and Namespaces in XML specifications, and the relationship between the Infoset and XML programming APIs.

Understanding XML Namespaces
Dedicated to answering what a namespace is, how namespaces are defined, and how they are used.

Extreme XML: Working with Namespaces in XML Schema
Shows how W3C XML Schema are affected by namespaces, including how to use the targetNamespace, elementFormDefault and attributeFormDefault attributes, and the include, import, and redefine elements within a schema. This article is from the Extreme XML series, also available on MSDN.

Understanding XML Schema
Explore the XML Schema definition language, which plays a central role in XML processing and Web services.

Designing XML Schema Libraries
Learn about designing schema libraries capable of modeling a wide range of programming language-specific type hierarchies in use today.

Supported XML Standards (W3C)

Extensible Markup Language (XML) 1.0 (Fifth Edition)
XML is a subset of SGML that is completely described in this document. Its goal is to enable generic SGML to be served, received, and processed on the Web in the way that is now possible with HTML. XML has been designed for ease of implementation and for interoperability with both SGML and HTML.

Also see XML 1.1 (Second Edition)

Namespaces in XML 1.1 (Second Edition)
XML namespaces provide a simple method for qualifying element and attribute names used in XML documents by associating them with namespaces identified by URI references.

XML Information Set (Second Edition)
This specification provides a set of definitions for use in other specifications that need to refer to the information in an XML document.

XML Path Language 2.0 (XPath)
XPath is a language for addressing parts of an XML document, designed to be used by both XSLT and XPointer.

XSL Transformations 2.0 (XSLT)
This specification defines the syntax and semantics of XSLT, which is a language for transforming XML documents into other XML documents.

XML Schema Part 1: Structures (Second Edition)
This document specifies the XML Schema definition language, which offers facilities for describing the structure and constraining the contents of XML 1.0 documents, including those that exploit the XML Namespace facility.

XQuery 1.0: An XML Query Language
This specification describes a query language called XQuery, which is designed to be broadly applicable across many types of XML data sources.

The XmlHttpRequest API
Provides client-side protocol support for communication with HTTP servers.

General XML Articles

The XML Diff and Patch GUI Tool
How to use the XmlDiff class to build an application that compares two XML files and shows these differences as an HTML document.

XML to SQL: Use SQLXML Bulkload in the .NET Framework
Showcases the Bulkload functionality available in SQLXML, which can be used to transform XML input into SQL data.

Generate Code in the .NET Framework Using XML Schema
Kick start your use of novel approaches to XSD storage and management, and the corresponding code generation and reuse.

Combine XML Documents with Xinclude
Learn about XInclude, an emerging W3C standard, and XPointer. Discover a specific implementation of XInclude for the .NET Framework.

XmlCsvReader
XmlCsvReader is a subclass of XmlReader that parses tab delimited .csv files returning the data as XML. XmlReader is a .NET Framework base class in the System.Xml namespace designed for stream level XML processing.

XML_Providers
This article covers several sample XPath-Navigator implementations.

Microsoft Visual Basic SAX2 Jumpstart
This article helps you get started building Simple API for XML (SAX2) applications with Microsoft Visual Basic. This document shows you how to quickly build an application that uses SAX2 to read an XML document and print the document's contents to a text box.

XSL Transformations: XSLT Alleviates XML Schema Incompatibility Headaches
The XSL Transformations (XSLT) specification defines an XML-based language for expressing transformation rules that map one XML document to another. XSLT has many of the constructs found in traditional programming languages, including variables, functions, iteration, and conditional statements. With this sample and the related article you'll learn how to use the XSLT instructions and template rules, manage namespaces, control transformation output, use multiple stylesheets, and employ pattern-matching with template rules. A sidebar explains how to access XSLT from MSXML using the IXSLTemplate and IXSLProcessor interfaces.

XML and the Database Articles

XML Indexes in SQL Server (2005 and later)
Use the relational query engine in SQL Server to make a single query plan for the SQL and XQuery parts of your queries, and make the implementation of XML queries fast and easy to predict and tune.

Introduction to XQuery in SQL Server
An introduction to various features of XQuery implemented in SQL Server (2005 and later) such as the FLWOR statement, operators in XQuery, if-then-else construct, XML constructors, built-in XQuery functions, type casting operators, and examples of how to use each of these features.

Optimize the XML Data Type in SQL Server
Discover ways to improve query and data modification performance of the XML data type in the Microsoft SQL Server (2005 and later).

XML Options in SQL Server
Three options for handling XML data in the Visual Studio/SQL Server environment (2050 and later) are discussed, including usage scenarios and guidelines to help you choose between them.

A Survey of Microsoft SQL Server XML Features
This article provides a roadmap of SQL Server XML features (SQL Server 2000 and later).

Exchanging XML with SQL Server and Reporting Services through the Web and Web Services
Venkat Prasad discusses programming techniques for saving XML data from SQL servers, Web servers, XML Web services, and SQL reporting servers.

Find Out What's New with FOR XML in SQL Server 2005
Details the major capabilities of the server-side FOR XML clause in SQL Server 2005 and later.

Optimizing SQLXML Performance
How to optimize SQLXML performance for SQL Server databases (2000 and later).

SQLXML Managed Classes
How to use SQLXML Managed Classes for .NET code to retrieve XML from a Microsoft SQL Server database or to generate XML on the client side, using ad hoc queries, stored procedures, annotated schemas with XPath, or XML templates.

XML Best Practices for SQL Server (2005 and later)
Learn about the guidelines for XML data modeling and usage in SQL Server.

How SQL Server Supports XML
Explore the XML support built into SQL Server (2005 and later). Learn how this support integrates with the programming support in the .NET Framework, OLEDB, and SQLXML.

XML to SQL: Using SQLXML Bulkload in the .NET Framework
Amar Nalla showcases the Bulkload functionality available in SQLXML, which can be used to transform XML input into SQL data.

Microsoft is conducting an online survey to understand your opinion of the MSDN Web site. If you choose to participate, the online survey will be presented to you when you leave the MSDN Web site.

Would you like to participate?