W3C home > Mailing lists > Public > xmlschema-dev@w3.org > October 2012

Re: Three equivalent ways to specify an unconstrained data type ... are there others?

From: Michael Kay <mike@saxonica.com>
Date: Sun, 21 Oct 2012 17:35:19 +0100
Message-ID: <50842447.4010403@saxonica.com>
To: xmlschema-dev@w3.org
The three types have the same value space, but they are not equivalent 
in other ways. For example, an element of type xs:NCName can appear in 
the substitution group of E1 but not of E2.

Michael Kay
Saxonica

On 20/10/2012 13:04, Costello, Roger L. wrote:
> Hi Folks,
>
> Below are declarations of three elements, E1, E2, and E3. All three elements have the same data type: an unconstrained string. All other data types (boolean, integer, etc.) can be similarly specified. Thus there are 3 ways to specify the same thing for every built-in data type.
>
> Can you think of any other ways to specify an unconstrained data type?
>
>      <xs:element name="E1" type="xs:string" />
>      
>      <xs:element name="E2" type="string-equivalent-1" />
>      
>      <xs:element name="E3" type="string-equivalent-2" />
>      
>      <xs:complexType name="string-equivalent-1">
>          <xs:simpleContent>
>              <xs:extension base="xs:string" />
>          </xs:simpleContent>
>      </xs:complexType>
>      
>      <xs:simpleType name="string-equivalent-2">
>          <xs:restriction base="xs:string" />
>      </xs:simpleType>
>
> /Roger
>      
>
>
Received on Sunday, 21 October 2012 16:35:37 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:16:02 UTC