W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > April to June 2000

Re: [comment] Mixed Content Model

From: Dan Connolly <connolly@w3.org>
Date: Fri, 12 May 2000 17:25:03 -0500
Message-ID: <391C84BF.DDA6F07C@w3.org>
To: nchen@webMethods.com
CC: w3c-xml-schema-ig@w3.org, www-xml-schema-comments@w3.org
nchen wrote:
> In the schema spec, it says "1.2.4  If the {content type} is element-only or
> mixed, the sequence of the element information item's element information
> item [children], if any, taken in order, is schema-valid with respect to the
> {content type}'s particle, as defined in Element Sequence Valid (Particle)
> (3.8)"(  http://www.w3.org/TR/xmlschema-1/#Complex_Type_Definition_details)
> .
> So how do we represent <!ELEMENT P (#PCDATA|a|b|c)> in schema?! The order
> and number of child elements are not constrained in XML 1.0

I believe you are mistaken. That syntax is not legal in XML 1.0.
There is a similar syntax that has the property that the
order and number of children are not constrained:

	<!ELEMENT P (#PCDATA|a|b|c)*>

(note the *).

This has a straightforward analog in XML Schema:

 <element name='P'>
  <complexType content='mixed'>
   <choice minOccurs='0' maxOccurs='unbounded'>
    <element ref='t:a'/>
    <element ref='t:b'/>
    <element ref='t:c'/>

>, and therefore
> many industry users have already used this model in their documents. How can
> they easily migrate these documents to schema? Or should we suggest them
> using DTDs for old documents but using schema when create new documents?
> All the best,
> Ninggang
> webMethods, Inc.
> Ph : 703-460-2510
> Fax: 703-460-2599
> URL: http://www.webMethods.com

Dan Connolly, W3C http://www.w3.org/People/Connolly/
Received on Friday, 12 May 2000 18:24:44 UTC

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