Extracting relational data from an XML document

Just as there are a number of alternative approaches to the extraction of data from a relational database and publishing it as XML, there are also a number of approaches that can be used to take data from an XML document and place it in a relational database.

One approach is to use the concept of shredding, where the content of the XML document is decomposed and stored in tables created using the XML structure. For example, the XML document in Figure H.5 can be shredded back into the structure in Figure H.1 (although it yields only one row, the ‘Finance’ row, in the department table). Alternatively, an XML document can be shredded into a single table, known as an ‘edge’ table. Figure H.6 shows ...

Get Principles of Data Management now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.