W3C home > Mailing lists > Public > xmlschema-dev@w3.org > March 2003

{content type} of derived type is mixed (XSV result)

From: Stanley Guan <stanley.guan@oracle.com>
Date: Thu, 13 Mar 2003 19:03:36 -0800
Message-ID: <073a01c2e9d6$4e92c570$c5b42382@us.oracle.com>
To: <xmlschema-dev@w3.org>
Cc: "Henry S. Thompson" <ht@cogsci.ed.ac.uk>

Based on "new versions of XML Schema REC documents with errata folded in",
it seems to me the following schema document should be invalid because the
{content type} of derived type (i.e., base2) is mixed while the {content
type}
of the {base type definition} is not.

However, XSV didn't detect such violation.  Is it because this new
constraint
was not implemented yet or my interpretation is wrong?

Thx,

-Stanley

==============================================
Schema Component Constraint: Derivation Valid (Restriction, Complex)

5.4 All of the following must be true:
5.4.1 One of the following must be true:
5.4.1.1 The {content type} of the complex type definition itself must be
element-only
5.4.1.2 The {content type} of the complex type definition itself and of the
{base type definition} must be mixed


===============================================
<?xml version="1.0"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">

 <xsd:element name="root">
  <xsd:complexType>
   <xsd:sequence>
    <xsd:element ref="test" minOccurs="0"/>
   </xsd:sequence>
  </xsd:complexType>
 </xsd:element>

 <xsd:element name="test" type="base1"/>

 <xsd:complexType name="base1" >
            <xsd:simpleContent>
  <xsd:extension base="xsd:integer">
                   <xsd:attribute name="any"/>
  </xsd:extension>
            </xsd:simpleContent>
 </xsd:complexType>

 <xsd:complexType name="base2" mixed="true" >
            <xsd:complexContent>
  <xsd:restriction base="base1">
   <xsd:attribute name="any" use="optional" />
  </xsd:restriction>
            </xsd:complexContent>
 </xsd:complexType>


</xsd:schema>
Received on Thursday, 13 March 2003 22:05:28 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:36 GMT