untitled

(ff) #1

48 2 XML Semantics



  1. string. Arbitrary text without embedded elements.

  2. decimal. A decimal number of any length and precision.

  3. integer. An integer of any length. This is a special case ofdecimal. There
    are many special cases of integer, such aspositiveIntegerandnonNega-
    tiveInteger.

  4. date. A Gregorian calendar date.

  5. time. An instant of time during the day, for example, 10:00.

  6. dateTime. A date and a time instance during that date.

  7. duration. A duration of time.

  8. gYear. A Gregorian year.

  9. gYearMonth. A Gregorian year and month in that year.

  10. boolean. Either true or false.

  11. anyURI. A web resource.


There are three ways to construct a new datatype from other datatypes:


  1. Restriction. The most common way to define a datatype is to restrict
    another datatype. For example, to define a telephone number, start with
    string and restrict to those strings that have an acceptable pattern of digits,
    and plus and minus signs. One can restrict using any combination of the
    following techniques:


(a) Bounds. The maximum and minimum, either inclusive or exclusive.
(b) Length. The number of characters of a string (minimum or maximum
or both), the number of digits of a number, or the number of digits after
the decimal point.
(c) Pattern. A pattern that must be matched. The XML pattern language
is similar to the one used by Perl; see subsection 10.1.4
(d) Enumeration. An explicit list of all possibilities.


  1. Union. One can combine the set of values of several datatypes. This is
    handy for adding special cases to another datatype.

  2. List. A sequence of values.

Free download pdf