- From: Pete Cordell <petexmldev@codalogic.com>
- Date: Wed, 17 Nov 2010 17:15:32 -0000
- To: <xmlschema-dev@w3.org>
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 17:16:21 UTC