RE: CR Feedback and Implementation

James,

perhaps it is not you, who is missing anything at all.

After re-reading 5.7 Model Group Constraints
(http://www.w3.org/TR/xmlschema-1/#coss-modelGroup) I would also come to the
conclusion, that someone on our team has probably overlooked the "Element
Declarations Consistent" constraint when submitting this example to me (and
I clearly didn't remember it either, so my filtering process failed
miserably in this instant ;)

Anyway, the point of the example was to be scary and to stress that such a
constraint should be included in XML Schema, and it indeed already is, so
everything is OK.

Alexander

... Alexander Falk
... President, CEO
... Altova, Inc. - The XML Spy Company

=========================================================================
XML Spy 3.0  -  the first true Integrated Development Environment for XML
Visit http://www.xmlspy.com/ to download a free 30-day evaluation version
=========================================================================


-----Original Message-----
From: James Clark [mailto:jjc@jclark.com]
Sent: Friday, December 15, 2000 05:25
To: al@altova.com
Cc: www-xml-schema-comments@w3.org
Subject: Re: CR Feedback and Implementation


> From: "Falk, Alexander" <al@altova.com>
> To: "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>
> Cc: "'w3c-xml-schema-ig@w3.org'" <w3c-xml-schema-ig@w3.org>
> Date: Thu, 14 Dec 2000 17:23:42 +0100
> Subject: CR Feedback and Implementation


That's a scary example. I thought it would violate the "Element
Declarations Consistent" constraint.  What am I missing?

> 2) consider the question of non-deterministic content models with respect
to
> local element declarations, e.g. in the following schema:
> 
>         <?xml version="1.0" encoding="UTF-8"?>
>         <!-- edited with XML Spy v3.5 NT beta 2 build Dec 11 2000
> (http://www.xmlspy.com) by Alexander Falk (Altova, Inc.) -->
>         <xsd:schema xmlns:xsd="http://www.w3.org/2000/10/XMLSchema"
> elementFormDefault="qualified">
>                 <xsd:element name="a">
>                         <xsd:complexType>
>                                 <xsd:sequence>
>                                         <xsd:element name="b"
minOccurs="0"
> maxOccurs="unbounded">
>                                                 <xsd:complexType>
>                                                         <xsd:sequence>
>
<xsd:element
> name="c" type="xsd:string"/>
>
<xsd:element
> name="d" type="xsd:string" minOccurs="0"/>
>                                                         </xsd:sequence>
>                                                 </xsd:complexType>
>                                         </xsd:element>
>                                         <xsd:element name="b"
minOccurs="0"
> maxOccurs="unbounded">
>                                                 <xsd:complexType>
>                                                         <xsd:sequence>
>
<xsd:element
> name="c" type="xsd:integer"/>
>
<xsd:element
> name="e" type="xsd:string" minOccurs="0"/>
>                                                         </xsd:sequence>
>                                                 </xsd:complexType>
>                                         </xsd:element>
>                                 </xsd:sequence>
>                         </xsd:complexType>
>                 </xsd:element>
>         </xsd:schema>
> 
> which declares two local elements <b> with different content models, that
> make the validation process entirely non-deterministic when it comes to
the
> following example XML instance document based on this schema:
> 
>         <?xml version="1.0" encoding="UTF-8"?>
>         <!-- edited with XML Spy v3.5 NT beta 2 build Dec 11 2000
> (http://www.xmlspy.com) by Alexander Falk (Altova, Inc.) -->
>         <a xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="multilocaldiff.xsd">
>                 <b>
>                         <c>0</c>
>                 </b>
>         </a>
> 
> Is the <b> element in this example the first or second local element b in
> the above schema - or more specifically - should the contents of c be
> interpreted as an xsd:string or xsd:integer? Only if the XML instance
> document is actually extended a bit:
> 
>         <?xml version="1.0" encoding="UTF-8"?>
>         <!-- edited with XML Spy v3.5 NT beta 2 build Dec 11 2000
> (http://www.xmlspy.com) by Alexander Falk (Altova, Inc.) -->
>         <a xmlns:xsi="http://www.w3.org/2000/10/XMLSchema-instance"
> xsi:noNamespaceSchemaLocation="multilocaldiff.xsd">
>                 <b>
>                         <c>0</c>
>                         <e/>
>                 </b>
>         </a>
> 
> it would theoretically be possible to validate this document against the
> schema, although, the fact that this kind of "grammar" defined by the
schema
> entirely violates any LL1 condition, allowing such a construct makes it
very
> hard to achieve compatibility between different vendors of schema-based
> validation.
> 
> I would, therefore, recommend that the use of multiple locally declared
> elements with the same name within one parent are either discouraged or
> outright forbidden by the Schema specification.

Received on Friday, 15 December 2000 05:47:30 UTC