Lists Home |
Date Index |
Dare Obasanjo wrote:
> In my personal opinion, an article that advises against using complex
> types in W3C XML Schema cannot claim to be without bias.
*In context* the admonisment seems quite reasonable to me. Essentially
he is saying: "XML Schema allows you to make a distinction between types
and elements but most people can get away without such a distinction and
arguably the distinction is not useful anyhow. So use a subset of XML
Schema that re-unifies elements and types and get on with life."
Note that he never said: "don't type <xs:complexType>" because then XML
Schema would really be useless. He said don't treat the element as a
first-class concept. Treat it as boilerplate syntax.
"Furthermore, you won't lose anything by not using complex types: if a
schema can be written by using complex types, then you can always write
it without complex types. To be precise, you can always write it without
understanding complex types, but unfortunately you have to type
"In short, a complex type is a model group, plus inheritance, minus ease
of use. A complex type and a model group are similar in the sense that
they are used to define content models. A complex type lacks ease of use
because you can't use it from other complex types or model groups. On
the other hand, model groups can be used without such restriction."
"... None of these problems occur if you use model groups instead of
complex types. When it comes to derivation by restriction, a general
understanding isn't enough; you need a very detailed understanding of
how it works."
So whether he is right or wrong, he argues clearly and IMO, without any
discernable bias. The article does seem a bit "rushed" and the points
could have been stated more clearly. For instance he could have said:
"Do not use complex types outside of element declarations."