XML technologies / XML Schema / Creating complex data types / Simple and complex types

(Excerpt from “XML Schema” by Eric van der Vlist)

Before exploring complex types, I want to stress the fundamental difference between simple and complex types. The simple data types discussed previously describe a text node’s content or an attribute value. They are wholly independent of other nodes and thus of markup. The same type system can describe content in any format, including non-XML formats such as RDBMS, relational database management systems, CSV, comma-separated values, or fixed-field text.

Complex types, especially complex content models, instead describe markup structure. They use simple data types to describe leaf element nodes and attribute values but otherwise have nothing to do with simple types. Remember this when exploring complex-type derivation. Even when names and elements match those of simple types, their meanings, uses and content models differ. For example, when discussing element xs:restriction, we will see different meanings and content models for simple and complex types; indeed, two distinct complex-type content models exist depending on context. Simple and mixed content models are special cases among complex-type models where elements may have text nodes.

Between simple types and complex content lies a no-man’s-land where the distinction between data and markup, or types and structures, becomes blurred for W3C XML Schema. This ambiguity often confuses human readers, schema-editing software for W3C XML Schema, and manuals.

   

 

 

 

back to top