Home. 
.

transparent

transparent

transparent

Altova Mailing List Archives


RE: empty xs:extension of a simple type

From: noah_mendelsohn@--.---.---
To: "Michael Kay" <mike@--------.--->
Date: 10/13/2008 12:27:00 PM
Michael Kay writes:

> It does raise the question of why simple types are something 
> radically different from complex types, rather than simply a 
> special case of a complex type that happens to define no 
> children and no attributes.

For what it's worth, this was debated at great length during the design of 
Schema 1.0.  Perhaps others will recollect differently, but I don't recall 
the analysis leading to a simple clear winner in the design space.  Not 
sure I could reproduce the pros and cons these many years later, but I 
think it was along the following lines:  we could have made no distinction 
in general between complex and simple types.  We then would have been in 
the position of saying that a type that just happened to have no 
attributes and happened to have stringlike content was special, and in 
particular could be used as the type of an attribute.  The alternative was 
to do what we did, which was to make a separately named abstraction for 
what we now know as simple and complex types.  For the most part, they are 
naturally disjoint, but the messy case is the one in question here, I.e. 
that the degenerate case of a complex type (I.e. no attributes and no 
element content) is mighty close to a simple type in what it does.  So, we 
could have tried to collapse just that case.  Take a complex type with 
simple content and an optional attribute, and now restrict away the 
attribute.  Should it magically turn into a simple type?  Hmm.  Seems a 
bit magical.  Anyway, I doubt I'm getting all the details right, but as I 
recall the discussion felt somewhat like that.  As I say, I didn't recall 
an obviously "best" choice, and the one way made seemed to be among the 
less painful/bizarre.

To some degree, all of this is a reflection of the assymmetry in XML 
between attribute and element content:  if XML attributes were just an 
unordered grouping of named items that allowed the same content as 
elements (I.e. structured), then I think the distinction between complex 
and simple types would have fallen away naturally.  The content allowed by 
elements is a superset of that allowed for attributes, and that asymmetry 
must be reflected in the type system somehow.

Noah

--------------------------------------
Noah Mendelsohn 
IBM Corporation
One Rogers Street
Cambridge, MA 02142
1-617-693-4036
--------------------------------------







transparent
Print
Mail
Like It
Disclaimer
.

These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on www.altova.com/list/index.html. Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.

.
.

transparent

transparent