1.4. Patterns in XML

In order to effectively model information using XML, we must learn how to identify the natural patterns inherent to it. First, we must determine whether we have used XML elements properly. To do this we will analyze the XML fragment shown in Listing 1.2.

Listing 1.2. Example XML Fragment
<colorimeter_reading>
      <device> X-Rite Digital Swatchbook </device>
      <patch> cyan </patch>
      <RGB resolution=8>
            <red> 0 </red>
            <green> 255 </green>
            <blue> 255 </blue>
      </RGB>
</colorimeter_reading>

We examine each data element and ask the following question:

  • Is this data, or is it actually metadata (information about another data element)?

We examine every attribute and ask the following questions:

  • Does the attribute tell us something about ...

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.