Re: Non-deterministic content model

Yuichi,

No: the fragment you sent:

  <element name='A'>
   <complexType content='elementOnly'>
    <element ref='test:B' minOccurs='0' maxOccurs='unbounded'/>
    <element ref='test:C' minOccurs='0'/>
    <element ref='test:B' minOccurs='0' maxOccurs='unbounded'/>
   </complexType>
  </element>

is syntactically valid against the schema DTD but it is an illegal 
definition because it would be, as an XML DTD:

<!ELEMENT A (test:B*, test:c?, test:B*)>

and this is illegal XML because it is non-deterministic, i.e. as Noah 
said it is not possible to determine if a test:B belongs to the first 
or last content particle. Change it to:

  <element name='A'>
   <complexType content='elementOnly'>
    <element ref='test:B' minOccurs='0' maxOccurs='unbounded'/>
    <element ref='test:C' minOccurs='1'/>
    <element ref='test:B' minOccurs='0' maxOccurs='unbounded'/>
   </complexType>
  </element>

i.e.
<!ELEMENT A (test:B*, test:c, test:B*)>

and you should be OK.

Or:
<!ELEMENT A (test:B*, (test:c, test:B*)?)>
would also be OK and probably nearer what you intended.


Robin

At 9:51 pm -0400 23/8/00, Yuichi Koike wrote:
>Thanks for the reply.
>
>So, I think, the message is a warning, and the
>instance is schema-valid. Is it right?
>
> > If you have the instance document:
> >
> >         <A>
> >                 <B/>
> >         </A>
> >
> > there is an ambiguity as to whether B matches the first or the third line
> > of the content model for A.  Therefore, the content model itself is
> > nondeterministic, as reported by XSV.
>
>--
>Yuichi Koike (koike@w3.org)
>World Wide Web Consortium (W3C)
>Technology and Society Domain
>http://www.w3.org/People/Koike/

-- -----------------------------------------------------------------
Robin La Fontaine, Monsell EDM Ltd
(R&D Project Management, Engineering Data Exchange using XML, EDIF)
Tel: +44 1684 592 144 Fax: +44 1684 594 504 or +44 870 054 2811
Email: robin@monsell.co.uk       http://www.monsell.co.uk

Received on Thursday, 24 August 2000 05:19:02 UTC