W3C home > Mailing lists > Public > xmlschema-dev@w3.org > June 2001

Re: Xml Schema Blues

From: Henry S. Thompson <ht@cogsci.ed.ac.uk>
Date: 11 Jun 2001 12:17:21 +0100
To: "Whitwell, Martyn" <martyn.whitwell@ic.ac.uk>
Cc: "'xmlschema-dev@w3.org'" <xmlschema-dev@w3.org>
Message-ID: <f5bwv6jw9j2.fsf@cogsci.ed.ac.uk>
"Whitwell, Martyn" <martyn.whitwell@ic.ac.uk> writes:

> After much work, I found this sort of xml document could be described by the
> schema:
> 
> <xsd:complexType name="typeEmpText" mixed="true">
>   <xsd:complexContent>
>     <xsd:extension base="xsd:string">
>       <xsd:sequence>
>         <xsd:element ref="bold" minOccurs="0" maxOccurs="unbounded"/>
>         <xsd:element ref="italic" minOccurs="0" maxOccurs="unbounded"/>
>         <xsd:element ref="underline" minOccurs="0" maxOccurs="unbounded"/>
>       </xsd:sequence>
>     </xsd:extension>
>   </xsd:complexContent>
> </xsd:complexType>
> 
> <xsd:element name="paragraph" type="typeEmpText"/>
> <xsd:element name="bold" type="typeEmpText"/>
> <xsd:element name="italic" type="typeEmpText"/>
> <xsd:element name="underline" type="typeEmpText"/>

Just get rid of the <xsd:complexContent> and <xsd:extension> -- mixed
content doesn't require or allow any specification of the type of the
intermixed text.

> This schema successfully validated the xml document I had prepared. 

It shouldn't have, it's not a legal schema doc't!

ht
-- 
  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2001, 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/
Received on Monday, 11 June 2001 07:17:32 GMT

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