[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

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>
xsd element node with simplecontent

> 
> 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

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.