NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

Accessing XML that Contains Relational Data

The XML and ADO+ frameworks provide rich support for a common scenario – working with XML data that has some relational content. The programming model enables the following approaches:

Figure 1 summarizes the programming model. Notice data can be read using one representation (for example, relational), then written using another representation (for example, XML). Therefore, either kind of data can be accessed within the same environment.

Figure 1

DataSet and XmlDataDocument

In Figure 1, data is read into and written from either an XmlDataDocument or a DataSet. The DataSet object, and associated supporting objects, provides a relational representation of data. This representation consists of tables/views, rows/columns, and relations/constraints (both unique and foreign).

The principal way of populating the DataSet is with commands, such as SQL query commands (executed with the assistance of managed provider objects). However, the DataSet object also supports reading XML directly.

The XmlDataDocument class derived from the XmlDocument class provides an XML representation of data. Data is represented as nodes, and components of nodes, in a W3C-compliant XML document. Data may be viewed as individual nodes, sets of nodes, or an entire document. Enhancements are provided for ease-of-use and high performance.

The principal way of populating the XmlDataDocument is by reading XML directly. Employing this object is the recommended way of invoking enhancements such as XML DTD and schema validation.