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

RE: Empty complexType with mixed="true"

From: Michael Kay <mike@saxonica.com>
Date: Tue, 18 Mar 2008 08:56:26 -0000
To: "'Shlomo Yona'" <S.Yona@F5.com>, <xmlschema-dev@w3.org>
Message-ID: <00ed01c888d5$f32fd930$6401a8c0@turtle>
If a complex type is empty, then no child elements are allowed. But if the
mixed=true, then you are still allowed text nodes, comments, and processing
instructions as children; and even if mixed=false, you are still allowed
comments and processing instructions (and empty CDATA sections, I think). So
it's wrong to say that an empty complex type disallows all content.
Michael Kay


From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On
Behalf Of Shlomo Yona
Sent: 18 March 2008 08:14
To: xmlschema-dev@w3.org
Subject: Empty complexType with mixed="true"


I have the following example test based on XML schema w3c test suite:


<?xml version="1.0"?>


<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
        <xs:complexType name="fooType" mixed="1"/>
        <xs:element name="root" type="fooType"/>

I understand from the spec that empty complex type forbids any content, but
apparently, mixed="1" overrides this and seems to allow textual content
which is anySimpleType.

Is this a correct interpretation of the spec?


Received on Tuesday, 18 March 2008 08:57:10 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:14 UTC