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

Re: Freely nested elements in Schema

From: Henry S. Thompson <ht@inf.ed.ac.uk>
Date: Thu, 29 Jan 2004 09:44:39 +0000
To: Wyatt Barton <hiddenharvest@yahoo.com>
Cc: xmlschema-dev@w3.org
Message-ID: <f5bbronf5rs.fsf@erasmus.inf.ed.ac.uk>

Indeed this is what substitution groups are for:

<xs:complexType name="text" mixed="true">
  <xs:sequence minOccurs="0" maxOccurs="unbounded">
   <xs:element ref="span"/>
 <xs:element name="span" abstract="true" type="text"/>
 <xs:element name="emph" substitutionGroup="span"/>
 <xs:element name="font" substitutionGroup="span"/>
 <xs:element name="strong" substitutionGroup="span"/>
 <xs:element name="img" substitutionGroup="span">
   <xs:complexContent mixed="false">
    <xs:restriction base="text"/>

Note that emph, font and strong will be of type 'text' by default.

 Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
                     Half-time member of W3C Team
    2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
            Fax: (44) 131 650-4587, e-mail: ht@inf.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 Thursday, 29 January 2004 04:44:55 UTC

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