- From: Savas Parastatidis <Savas.Parastatidis@newcastle.ac.uk>
- Date: Wed, 2 Jul 2003 18:52:29 +0100
- To: "Henry S. Thompson" <ht@cogsci.ed.ac.uk>
- Cc: <xmlschema-dev@w3.org>, "Jim Webber" <jim.webber@arjuna.com>, "Paul Watson" <Paul.Watson@newcastle.ac.uk>
> > <xs:complexType name="myType"> > > <xs:complexContent> > > <xs:restriction base="xs:element"> > > ... > > </xs:restriction> > > </xs:complexContent> > > </xs:complexType> > > > > With xmlns:xs="http://www.w3.org/2001/XMLSchema" > > There's nothing I'm aware of in the REC to stop you doing this. > > There is a type definition with that name in the schema for schemas. > Like any other type definition that doesn't include > final='restriction', you can derive new type definitions from it by > restriction. > Please see bellow why I think why you can't do that. > Purists would probably argue you should include > > <xs:import namespace="http://www.w3.org/2001/XMLSchema"/> > I believe that this is not necessary. When you define an XML Schema, the above namespace is assumed to be already imported. I may be wrong in this but including the above line in XmlSpy and VS.NET 2003 does not help in validating the XML Schema I posted in my previous message. > > What made you think this wasn't allowed? I didn't understand your > comment "since the XML Schema specification is defined as an infoset, > the XML Schema <element> element that is defined in the normative XML > Schema schema (I hope this makes sense) should not be used in the > above manner". > Here's why I believe that "xs:element" cannot be used as base in an XML Schema declaration. The XML Schema infoset defines a tree of information items with the {namespace} property for all of them set to "http://www.w3.org/2001/XMLSchema" (section 3.1.2). So, when one uses <xs:restriction base="xs:element"> What should a tool do? Should it refer to the "element" complex type defined in http://www.w3.org/2001/XMLSchema by the normative XML Schema or should it refer to the more general, representation-independent XML Schema information item defined by the XML Schema infoset in the same namespace? The two tools I tried seem to agree with me although I don't know whether this because of a bad implementation of the XML Schema standard. Regards, .savas.
Received on Wednesday, 2 July 2003 13:58:29 UTC