W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > July to September 2002

Re: redundant mixed="true" required?

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 26 Aug 2002 09:10:56 +0100
To: Masayasu Ishikawa <mimasa@w3.org>
Cc: xmlschema-dev@w3.org, www-xml-schema-comments@w3.org
Message-ID: <f5bk7medoq7.fsf@cogsci.ed.ac.uk>

Masayasu Ishikawa <mimasa@w3.org> writes:

> Suppose that I have a schema like this:


>   <xs:complexType name="mixed" mixed="true">
>     <xs:choice minOccurs="0" maxOccurs="unbounded">
>       <xs:element ref="test:a"/>
>       <xs:element ref="test:b"/>
>     </xs:choice>
>   </xs:complexType>
>   <xs:element name="root">
>     <xs:complexType>
>       <xs:complexContent>
>         <xs:extension base="test:mixed">
>           <xs:attribute name="id" type="xs:ID"/>
>         </xs:extension>
>       </xs:complexContent>
>     </xs:complexType>
>   </xs:element>


> And an instance would be something like this:
> <root xmlns="http://example.com/test">
>   ccc<a>aaa<b>bbb</b>aaa</a>ccc<b>bbb<a>aaa</a>bbb</b>ccc
> </root>
> MSV (20020414), Xerces-J 2.0.2 and XML Spy 4.4 reported no problem,
> but XSV (online version, complained
> like this:
>     Invalid per cvc-complex-type.1.2.3: text not allowed: | ccc|

> What's/who's wrong?

XSV bug, sorry.  Will take a little while to fix, I'm in the midst of
preparing a new release which is involving a bunch of reorganisation.

Note however that this 'redundancy' can only be avoided when the
extending definition is empty -- if any substantive element content is
added, then the result is specified by the REC to take its 'mixed'
from the extending definition.  But the REC also rules out extending
mixed with element-only or vice-versa, so there's no point.

This isn't a big deal, but it should probably be fixed, by
 a) specifiying that in complexContent extension, the mixed _always_
    comes from the base;
 b) ruling out conflicting 'mixed' on <complexType> or
    <complexContent> when deriving by extension.

  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2002, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.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 Monday, 26 August 2002 04:11:01 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:08:59 UTC