untitled

(ff) #1

42 2 XML Semantics


Figure 2.7 XML data model for a molecule represented using CML.

2.3 XML Schema


As XML began to be used for applications other than technical documents,
the limitations and flaws of DTDs soon became apparent.


  1. The DTD uses a very different syntax from that of XML.

  2. There are only a few data types. Because of this limitation, nearly all
    attributes are defined to have type CDATA, that is, ordinary text, more
    commonly known asstrings. Important types such as numbers, times,
    and dates cannot be specified.

  3. Techniques that are common in modern databases and programming lan-
    guages such as customized types and inheritance are not available.
    As a result, an effort was started to express DTDs in XML and to support
    more general data-structuring mechanisms. The end result was XML Schema
    (W3C 2001c), often abbreviated as XSD. There are two parts to XSD:

  4. Part 1: Complex data types. These can be used to define all of the com-
    monly used data structures used in computer science, such as lists and
    records.

  5. Part 2: Simple data types. These include numbers, times, durations of
    time, dates, and web addresses. One can also introduce customized sim-

Free download pdf