Re: Xml Schema Blues

"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 UTC