20.5. Discussion

Two approaches to modeling the columns in an RDBMS as an XML DTD structure are

  • Element approach: Define the table name as the root element. It is nested by its columns, which are also defined as elements. An example is

    <! ELEMENT Person (Name, Sex, Age)>
    <! ELEMENT Name (#PCDATA)>
    <! ELEMENT Sex (#PCDATA)>
    <! ELEMENT Age (#PCDATA)>
    
  • Attribute approach: The columns are defined as attributes of the root element. The previous example becomes

    <! ELEMENT Person>
    <! ATTLIST Person
    Name CDATA #REQUIRED
    Sex CDATA #REQUIRED
    Age CDATA #REQUIRED>
    

In a relational database, data and structures are defined. Columns represent data. Tables and relationships form structure. This can be managed well in searching for data and for database navigation. ...

Get XML Data Management: Native XML and XML-Enabled Database Systems 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.