About simpleTypes in XML Schemas

XML Schema defines several kinds of simpleTypes:

  • Atomic is the term for most of the simpleTypes built in to XML Schema, such as integer, string, and decimal. They are called "atomic" because in the context of XML Schema, no part of an element or attribute of an atomic type has meaning on its own. It is only the whole instance that has meaning.

Descriptions of the XML Schema built-in types are in the W3C XML Schema Part 2: Datatypes.

  • List simpleTypes are sequences of atomic types. All elements of a particular list simpleType are instances of the same atomic type.
  • Union simpleTypes are sequences of atomic and list types. However, the elements of a particular union simpleType can be instances of more than one atomic or list type.
  • Anonymous simpleTypes are simpleType definitions that are not explicitly named. An anonymous simpleType can be an atomic, list, or union simpleType. You define an anonymous simpleType in the element or attribute definition that uses it.

Anonymous simpleTypes are useful when you want to define a type that is used in only one element or attribute. By specifying an anonymous simpleType, you save the overhead of explicitly defining the type and specifying a reference to it.

Free Stylus Studio XML Training: