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

Comments on Datatypes

From: Arnold, Curt <Curt.Arnold@hyprotech.com>
Date: Thu, 24 Jun 1999 15:06:16 -0600
Message-ID: <61DAD58E8F4ED211AC8400A0C9B468731AADD2@THOR>
To: "'www-xml-schema-comments@w3.org'" <www-xml-schema-comments@w3.org>
Some picky little items that I didn't see mentioned in other messages.

1. In this fragment of the schema, all the targets of the modelGroupRef's
are defined as elementType's. 

<modelGroup name="unordered">
   <choice>
      <modelGroupRef name="lexicalRepresentation"/>
      <modelGroupRef name="enumeration"/>
      <modelGroupRef name="length"/>
      <modelGroupRef name="maxLength"/>
   </choice>
</modelGroup>

Should it not be

<modelGroup name="unordered">
   <choice>
      <elementTypeRef name="lexicalRepresentation"/>
      <elementTypeRef name="enumeration"/>
      <elementTypeRef name="length"/>
      <elementTypeRef name="maxLength"/>
   </choice>
</modelGroup>

2. In both the schema and DTD, you allow zero or more occurances of either
the ordered or unordered groups.

<!ELEMENT datatype (basetype, (%ordered; | %unordered;)*)>

      <choice minOccur="0" maxOccur="*">
         <modelGroupRef name="ordered"/>
         <modelGroupRef name="unordered"/>
      </choice>

This counteracts any other constraints that you try to add in any of the
other groups.  For example, it looks like, in the bounds group, you were
trying to enforce that minInclusive appear before maxInclusive and to
prohibit minInclusive being matched with a maxExclusive.

   <choice>
      <sequence>
         <elementTypeRef name="minInclusive" minOccur="0" maxOccur="1"/>
         <elementTypeRef name="maxInclusive" minOccur="0" maxOccur="1"/>
      </sequence>
      <sequence>
         <elementTypeRef name="minExclusive" minOccur="0" maxOccur="1"/>
         <elementTypeRef name="maxExclusive" minOccur="0" maxOccur="1"/>
      </sequence>
   </choice>

With the schema and DTD, basically you have to have the basetype and then
you can have any combination and any number of repetitions of any other
element.  I think that it would be much more beneficial to attempt to
provide some restraint (for example, not specifying minInclusive and
minExclusive) for the same data type and either only specifying ordered
qualifiers or unordered qualifiers, even though that would enforce a more
rigid sequence of elements.

3. Bounds group

Wouldn't the previous sequence (assuming that you address the previous issue
with the * on the (ordered | unordered) clause, be better as

      <sequence>
   	<choice>
         		<elementTypeRef name="minInclusive" minOccur="0"
maxOccur="1"/>
         		<elementTypeRef name="minExclusive" minOccur="0"
maxOccur="1"/>
      	</choice>
      	<choice>
         		<elementTypeRef name="maxInclusive" minOccur="0"
maxOccur="1"/>
         		<elementTypeRef name="maxExclusive" minOccur="0"
maxOccur="1"/>
      	</choice>
      </sequence>

Which would enforce that min occurs before max and that you could mix and
match a minInclusive with a maxExclusive.

If desired I can email diagrams of the current schema and/or my pass at a
tightened up schema and DTD.
Received on Thursday, 24 June 1999 17:07:59 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:12:46 GMT