Mapping schemes for XML collections

For using the XML collection method, you must select a mapping scheme that defines how XML data is represented in a relational database.

For example, let us consider the DTD shown in Example 6-14.

Example 6-14 Sample DTD

<!ELEMENT employee (name, dept, proj*)> <!ATTLIST employee empno CDATA #REQUIRED> <!ELEMENT name (firstname, lastname)> <!ELEMENT firstname (#PCDATA)> <!ELEMENT lastname (#PCDATA)> <!ELEMENT dept (#PCDATA)>

<!ELEMENT proj (projno, startdate)> <!ELEMENT projno (#PCDATA)> <!ELEMENT startdate (#PCDATA)>

For the sample DTD shown in Example 6-14, we can determine how we want to create the tables (for decomposition) to map to the incoming XML document to table columns. Figure 6-16 shows an example of the mapping scheme.

136 The XML Files: Development of XML/XSL Applications Using WebSphere Studio

Page 152
Image 152
IBM Version 5 manual Mapping schemes for XML collections, Example 6-14 Sample DTD