- From: Kevin Braun <kbraun@obj-sys.com>
- Date: Wed, 17 Nov 2010 13:27:34 -0500
- To: Pete Cordell <petexmldev@codalogic.com>
- CC: xmlschema-dev@w3.org
Hi, I believe under XSD 1.0 it is valid but under XSD 1.1 it would not be. See http://lists.w3.org/Archives/Public/xmlschema-dev/2009Feb/0040.html and the subsequent discussion; I believe it is the same question. Kevin On 11/17/2010 12:15 PM, Pete Cordell wrote: > I have a customer who has a schema that extends a simple type double > into a complex type with simple content, and then as a separate > construct extends that into a complex type with complex content. They > do this along the following lines: > > <xs:complexType name="DoubleBase"> > <xs:simpleContent> > <xs:extension base="xs:double"> > <xs:attribute name="DoubleBaseAttr" type="xs:boolean"/> > </xs:extension> > </xs:simpleContent> > </xs:complexType> > > <xs:complexType name="DoubleBaseExtension"> > <xs:complexContent> > <xs:extension base="DoubleBase"> > <xs:attribute name="DoubleExtensionAttr" type="xs:boolean"/> > </xs:extension> > </xs:complexContent> > </xs:complexType> > > (To avoid confusion, the intent of the latter is to add the > DoubleExtensionAttr attribute rather than mandate that you've got > complexContent.) > > My feeling is this is wrong because DoubleBaseExtension should specify > xs:simpleContent rather than xs:complexContent. > > However, XML Spy and Visual Studio seem to accept the above, and the > example is actually based on a industry consortium schema that > specifies similar constructs. > > So my questions are: > > 1) Is the above schema correct or not? > > 2) If it is technically incorrect, is it widely occurring (possibly > because tools fail to pick it up) and therefore worth overlooking this > error? > > Thanks, > > Pete Cordell > Codalogic Ltd > Interface XML to C++ the easy way using C++ XML > data binding to convert XSD schemas to C++ classes. > Visit http://codalogic.com/lmx/ or http://www.xml2cpp.com > for more info > > > > >
Received on Wednesday, 17 November 2010 18:28:06 UTC