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

Re: empty xs:extension of a simple type

From: Andrew Welch <andrew.j.welch@gmail.com>
Date: Wed, 8 Oct 2008 15:26:16 +0100
Message-ID: <74a894af0810080726r5959f352j8211c642c492a599@mail.gmail.com>
To: "Michael Kay" <mike@saxonica.com>
Cc: xmlschema-dev@w3.org
Re: empty xs:extension of a simple type

2008/10/8 Michael Kay <mike@saxonica.com>:
>>
>> I'm looking at a machine generate schema which contains this:
>>
>> <xs:complexType name="foo">
>>   <xs:simpleContent>
>>     <xs:extension base="xs:string">
>>     </xs:extension>
>>   </xs:simpleContent>
>> </xs:complexType>
>>
>> That's just the same as type="xs:string" isn't it?
>>
>
> Not quite. It's a complex type rather than a simple type. It validates the
> same content as xs:string, but it can be extended and restricted (and
> unioned and listed...) in different ways from xs:string. It's likely to
> behave differently when you do Java data binding, and it's certainly
> different when you do type-aware XQuery and XSLT.

Different in a good way or different in a bad way? :)

Depending on the answer to that, I'm wondering if instead of using
type="xs:string" it would be worthwhile to have type="myString" with:

<xs:complexType name="myString">
 <xs:simpleContent>
   <xs:extension base="xs:string"/>
 </xs:simpleContent>
</xs:complexType>




-- 
Andrew Welch
http://andrewjwelch.com
Kernow: http://kernowforsaxon.sf.net/
Received on Wednesday, 8 October 2008 14:26:52 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.