Essential ADO.NET: XML and Data Access Integration
The DataSet class interoperates with XML schema and data. The XmlDataDocument combines XmlDocument and DataSet functionality.
7.1 XML and Traditional Data Access
The preceding chapters have talked about the data access stack mostly as it relates to traditional data access and relational data. Each time, I've mentioned nonrelational data (homogeneous and heterogeneous hierarchies and semistructured data) almost as an afterthought, or to illustrate that it would be a stretch to support it by using the classes in System.Data. But a wide variety of data can be represented in a nonrelational way. Here are a few examples.
LDAP readable directories, such as Active Directory, contain multivalued attributes. This violates relational theory's first normal form.
Each item in the NT file system is either a directory or a file. This is an example of a heterogeneous hierarchy. A related case is the reading of data from an Exchange store. Not only are contacts in the Contacts folder structured differently from mail messages in the Inbox, but also each mail message can contain 0N attachments. The attachments can also vary in data format. Exchangeor other IMAP (Internet Mail Access Protocol) mail systemscan also expose hierarchical folders. All these data structures are analogous to the multiset in IDMS.
Screen scraping from HTML or XML pages consists of reading through a combination of text and tags and extracting only the data you needfor example, the number in the third column of the fourth row of an HTML table and the contents of the third <h3> tag. This is an example of semistructured data.
There are ways to approximate each different data typewith the possible exception of semistructured databy using a variation of a relational concept. Sometimes, however, you need to present the data in an alternative, nonrelational format. For example, suppose you're managing an electronic student registration form that contains data that affects the value of 15 different normalized relational tables. In addition, the form may contain information, such as a request for low-fat, vegetarian meals, that has no correlation in the relational schema. You may want to store the information in the request into multiple tables and reproduce the original request on demand. This might require that you retain additional information or even the entire request in its original form. It might also be nice if the information could be transmitted in a platform-independent, universally recognized format. Enter XML.