- From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
- Date: 07 Nov 2001 10:30:39 +0000
- To: "Aung Aung" <aaung@microsoft.com>
- Cc: <xmlschema-dev@w3.org>, "Ashok Malhotra" <ashokma@microsoft.com>, "Huseyin Ulger" <ulger@microsoft.com>, "Yan Leshinsky" <yanl@microsoft.com>, "David Brown (WEBDATA)" <davebrow@microsoft.com>
"Aung Aung" <aaung@microsoft.com> writes: > Spec says > In section 3.14.1 of structure spec: "The simple *ur-type definition* > must not be named as the *base type definition* of any user-defined > simple types: as it has no constraining facets, this would be > incoherent." > > In section 2.5.2 of datatyes spec: "[Definition:] There exists a > conceptual datatype, whose name is anySimpleType, that is the simple > version of the ur-type definition from [XML Schema Part 1: Structures]. > anySimpleType can be considered as the *base type* of all *primitive* > types. The *value space* of anySimpleType can be considered to be the > *union* of the *value space*s of all *primitive* datatypes." > > That means anySimpleType cannot be used as base type definition of any > user-defined simple types. > > Q1: why does the normative XSD in datatype spec > (http://www.w3.org/TR/xmlschema-2/#schema) have <restriction > base="xs:anySimpleType"> all over the places? Because these are not user-defined types, they are syntactic approximations to the built-in types. > Q2: > The following should all fail to validate. Correct? Or I am missing > something? > 1. > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > > <xs:simpleType name="ct1"> > <xs:restriction base="xs:anyType" /> > </xs:simpleType> > </xs:schema> Yes, invalid. > 2. > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > > <xs:simpleType name="ct2"> > <xs:restriction base="xs:anySimpleType" /> > </xs:simpleType> > </xs:schema> Yes, invalid. > 3. > <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" > > <xs:complexType name="ct4"> > <xs:simpleContent> > <xs:restriction base="xs:anySimpleType" /> > </xs:simpleContent> > </xs:complexType> > </xs:schema> Yes, invalid. But you raise an interesting point -- the above don't actually attempt a restriction, just a private renaming. There's no reason we shouldn't allow this. The third case in particular, if it contained attributes, is something people might reasonably wish to do. I'll raise a potential erratum on this. ht -- Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh W3C Fellow 1999--2001, part-time member of W3C Team 2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440 Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk URL: http://www.ltg.ed.ac.uk/~ht/
Received on Wednesday, 7 November 2001 05:29:45 UTC