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

Derivation of mixed content models 2nd

From: hans meier <hansmeier000@yahoo.de>
Date: Thu, 15 May 2003 15:29:16 +0200 (CEST)
Message-ID: <20030515132916.52969.qmail@web20505.mail.yahoo.com>
To: xmlschema-dev@w3.org
Hello,
I came across the following thread on the derivation of mixed
content models.
http://lists.w3.org/Archives/Public/xmlschema-dev/2001Oct/0113.html
If I am not misinterpreting Henry´s answer, the follwing combinations
are allowed
 
Derivation by extension
-----------------------
base type           derived type
mixed="true"       mixed="true"
mixed="false"      mixed="false"

Derivation by restriction
-------------------------
base type           derived type
mixed="true"       mixed="true"
mixed"false"        mixed="false"
mixed="true"       mixed="false"  if all element content is optional
 
so it should be an error, if there is mixed="false" in
the base type and mixed="true" in the restricted type.
 
So why do XSV 2.4 and MSXML 4.0 SP2 say, that the following is valid?
----------------------------------------------------------------------------------
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
<xs:complexType name="base" >
   <xs:sequence>
      <xs:element name="bar" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
   </xs:sequence>
</xs:complexType>
<xs:element name="foo">
   <xs:complexType mixed="true">
      <xs:complexContent>
         <xs:restriction base="base">
            <xs:sequence>
               <xs:element name="bar" type="xs:string" minOccurs="0" maxOccurs="unbounded"/>
            </xs:sequence>
         </xs:restriction>
      </xs:complexContent>
   </xs:complexType>
</xs:element>
</xs:schema>
----
<foo xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
     xsi:noNamespaceSchemaLocation="05_mixedDeriv_nm_m_r.xsd">
text
<bar/>
</foo>
-------------------------------------------------------------------------------------
Error or misunderstanding on my side?
Please bring some light in the dark.
Thank you
Hans



---------------------------------
Gesendet von http://mail.yahoo.de.
WAHNSINN! Nur 1x anmelden und dann vollautomatisch an bis zu 2400 Gewinnspielen teilnehmen! www.shortwin.de.
Received on Thursday, 15 May 2003 09:30:47 GMT

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