[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: Not a valid restriction of the content model problem

From: Henry S. Thompson <ht@inf.ed.ac.uk>
Date: Tue, 29 Mar 2005 10:50:09 +0100
To: "Wilde Rebecca L SSgt HQ SSG/SWO" <Rebecca.Wilde@Gunter.AF.mil>
Cc: <xmlschema-dev@w3.org>
Message-ID: <f5boed293xq.fsf@erasmus.inf.ed.ac.uk>
not valid for content model

Your schema is valid per XSV [1].  However, XSV uses an experimental
implementation of restriction which the XML Schema WG is planning to
move to for XML Schema 1.1, so that's not definitive.

The validity of the derivation in question (AlphabetSoupType from
ContentType) turns on a fairly obscure point in XML Schema 1.0,
thrashed out on this list some years ago [2].

Bottom line -- XML Spy _should_ accept your schema, but it's a bug
other processors have shown before now that it doesn't.

You could _try_ the following (admittedly obnoxious) workaround:  
<xs:schema ...>
 <xs:import namespace="http://www.w3.org/2001/XMLSchema"/>

 . . .

 <xs:complexType name="ContentType">
  <xs:choice>
   <xs:element ref="xs:annotation"/> <!-- never happen -->
   <xs:any namespace="##targetNamespace" minOccurs="0" maxOccurs="unbounded"/>
  </xs:choice>
  <xs:anyAttribute namespace="##local"/>
 </xs:complexType>

 <xs:complexType name="AlphabetSoupType">
  <xs:complexContent>
   <xs:restriction base="ContentType">
   <xs:choice>
    <xs:element ref="xs:annotation"/> <!-- never happen -->
     <xs:sequence>
      <xs:group ref="AOrBGroup"/>
      <xs:element ref="C" minOccurs="0"/>
      <xs:element ref="D"/>
     </xs:sequence>
    </xs:choice>
    <xs:attributeGroup ref="SizeAttributeGroup"/>
   </xs:restriction>
  </xs:complexContent>
 </xs:complexType>

 . . .
</xs:schema>

Hope this helps,

ht

[1] http://www.ltg.ed.ac.uk/~ht/xsv-status.html
[2] http://lists.w3.org/Archives/Public/xmlschema-dev/2003Oct/0017.html
-- 
 Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                     Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: ht@inf.ed.ac.uk
                   URL: http://www.ltg.ed.ac.uk/~ht/
[mail really from me _always_ has this .sig -- mail without it is forged spam]
Received on Tuesday, 29 March 2005 09:50:14 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.