RE: [comment] Mixed Content Model

Hi Dan,

Thank you for your answer. I was wrong. However, I still feel confused about
the Mixed Content Model in schema.

From the example and explanation in the primer, it seems

<element name='P'>
  <complexType content='mixed'>
   <sequence>
    <element ref='t:a'/>
    <element ref='t:b'/>
    <element ref='t:c'/>
   </sequence>
  </complexType>
 </element>

is identical to

<element name='P'>
  <complexType content='mixed'>
    <element ref='t:a'/>
    <element ref='t:b'/>
    <element ref='t:c'/>
  </complexType>
 </element>

Is this correct? But in  http://www.w3.org/TR/xmlschema-1/#declare-type, it
says

<Snip>
4.3  if the content [attribute] is mixed then a particle whose properties
are as follows:
{min occurs}
0
{max occurs}
unbounded
{term}
A model group whose {compositor} is CHOICE and whose {particles} are as
above for the elementOnly case.
</Snip>

So it is a choice not sequence?! Do I miss something?


Ref: http://www.w3.org/TR/xmlschema-0/#mixedContent

<Snip>

Note that the mixed model in XML Schema differs fundamentally from the mixed
model in XML 1.0. Under the XML Schema mixed model, the order and number of
child elements appearing in an instance must agree with the order and number
of child elements specified in the model.
</Snip>




Ref: http://www.w3.org/TR/xmlschema-1/#Complex_Type_Definition_details

<Snip>
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)
</Snip>




-----Original Message-----
From: w3c-xml-schema-ig-request@w3.org
[mailto:w3c-xml-schema-ig-request@w3.org]On Behalf Of Dan Connolly
Sent: Friday, May 12, 2000 6:25 PM
To: nchen@webMethods.com
Cc: w3c-xml-schema-ig@w3.org; www-xml-schema-comments@w3.org
Subject: Re: [comment] Mixed Content Model


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'/>
   </choice>
  </complexType>
 </element>

>, 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 Tuesday, 13 June 2000 18:34:01 UTC