W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2004

Constraining a mixed type ?

From: Bruno Chatel <bcha@chadocs.net>
Date: Fri, 16 Apr 2004 09:10:53 +0200
Message-ID: <0a9a01c42381$f57315d0$0600a8c0@chadocshome.com>
To: <xmlschema-dev@w3.org>
Cc: "Pierre Attar" <attar@tireme.fr>, "Bruno Chatel" <bcha@chadocs.net>


I wonder if it is possible to define a constrain on a mixed content using
XML Schemas. 
For example, I need to specify that there is at least one character in my mixed

I try the following schema :

<xs:simpleType name="nonempty-content-ST">
    <xs:restriction base="xs:string">
        <xs:minLength value="1"/>

<xs:complexType name="nonempty-content-CT">
        <xs:extension base="nonempty-content-ST"/>

<xs:complexType name="mixed-content-CT" mixed="true">
    <xs:complexContent mixed="true">
        <xs:extension base="nonempty-content-CT">
            <xs:choice maxOccurs="unbounded">
                    <xs:element name="emph" type="xs:string"/>

<xs:element name="p" type="mixed-content-CT"/>

But it have problem to validate a document such 


is this schema correct ?

It there an other  way to write this ?

Thanks in advance

-- bruno -- 
Bruno Chatel
Tel : (+33) (0)4 96 11 14 57
Received on Friday, 16 April 2004 03:05:07 UTC

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