W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2006

RE: simpletype or <xsd:complexType with simpleContent?

From: Michael Kay <mike@saxonica.com>
Date: Thu, 12 Jan 2006 09:00:57 -0000
To: "'Dan Vint'" <dvint@dvint.com>, <xmlschema-dev@w3.org>
Message-ID: <E1EwyKT-0002Ep-GX@lisa.w3.org>

> 
> Can someone explain these two constructs and any advantage or 
> disadvantage 
> to using one over the other?

For elements, it's true enough that a complex type with simple content and
no attributes is much the same as a simple type. But a simple type can also
be used to define the type of an attribute.

When it comes to writing schema-aware queries and stylesheets, simple types
(especially atomic types) are much more flexible than complex types, because
a free-standing XPath value can have an atomic type, but only element nodes
can have a complex type. There might be similar considerations when using
data binding tools, I don't know.

Michael Kay
http://www.saxonica.com/
Received on Thursday, 12 January 2006 09:01:12 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:52 GMT