W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2002

conplexType with mixed="true" and no content.

From: KAZUMI Saito <ksaito@jp.fujitsu.com>
Date: Thu, 11 Apr 2002 20:09:47 +0900
Message-Id: <200204111109.AA02622@OTOHIME.jp.fujitsu.com>
To: xmlschema-dev@w3.org
From my read of the schema recomenndation, following xml instance
is not valid against that schema.

XSD:
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
  <xs:element name="root">
    <xs:complexType mixed="true"/>
  </xs:element>
</xs:schema>

XML:
<root>text</root>

Because, the rec says in "Complex Type Definition with complex content
Schema Component", 

{content type}:
1.1 If one of the following is true
1.1.1 There is no <group>, <all>, <choice> or <sequence> among the [children]; 
  ...
, then empty; (*1)
1.2 otherwise a pair consisting of 
1.2.1 the appropriate case among the following:
1.2.1.1 If the mixed [attribute] is present on <complexContent>,
        then mixed if its ?actual value? is true, otherwise elementOnly;
1.2.1.2 If the mixed [attribute] is present on <complexType> and its ?actual
        value? is true, then mixed;
1.2.1.3 otherwise elementOnly.
1.2.2 The particle corresponding to the <all>, <choice>, <group> or <sequence>
      among the [children]. 

clause  1.2.1 above makes menthion of mixed attribute, but clause 1.1.1
is match first, then the <root> element must be empty, I think.

clause 1.2.1.x is prior to clause 1.1 ?

-----
 KAZUMI Saito  FUJITSU Ltd.
Received on Thursday, 11 April 2002 07:08:18 GMT

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