W3C home > Mailing lists > Public > www-forms-editor@w3.org > February 2002

XML Schema Comments on XForms 1.0 Working Draft

From: Martin Gudgin <marting@develop.com>
Date: Thu, 21 Feb 2002 19:13:38 -0000
Message-ID: <063e01c1bb0b$dff9d0d0$b47ba8c0@zerogravitas>
To: <www-forms-editor@w3.org>
Cc: "XML Schema WG" <w3c-xml-schema-wg@w3.org>
Below are the comments from the XML Schema Working Group on the XForms
January 18th Working Draft

Regards

Martin Gudgin
For the XML Schema Working Group


Comments;

1.    Section 3.2 refers to a type called xsd:idref, should be xsd:IDREF


2.    Section 6.3.2 - The example is incorrect. It will always assign a type
of xsd:string to instance data, rather than the anonymous inline simpleType.
Should be rewritten using a named type;

    <xsd:simpleType name='CCType' >
      <xsd:restriction base="xsd:string">
        <xsd:enumeration value="MusterCard"/>
        <xsd:enumeration value="Donor'sClub"/>
        <xsd:enumeration value="WildExpress"/>
      </xsd:restriction>
    </xsd:simpleType>


    <xsd:simpleType>
      <xsd:union memberTypes="tns:CCType" xsd:string"/>
    </xsd:simpleType>


3.    Section 6.3.3. - Union. This section may make more sense before 6.3.2
given that 6.3.2 uses union


4.    Schema for XForms -


 <xsd:attributeGroup name="commonUIAttributes">
    <xsd:attribute ref="xml:lang" type="xsd:language" use="optional"/>
    <xsd:attribute name="class" type="xsd:string" use="optional"/>
    <xsd:attribute name="accessKey" type="xsd:string" use="optional"/>
    <xsd:attribute name="navIndex" type="xsd:nonNegativeInteger"
use="optional"/>
  </xsd:attributeGroup>

should be

 <xsd:attributeGroup name="commonUIAttributes">
    <xsd:attribute ref="xml:lang" use="optional"/>
    <xsd:attribute name="class" type="xsd:string" use="optional"/>
    <xsd:attribute name="accessKey" type="xsd:string" use="optional"/>
    <xsd:attribute name="navIndex" type="xsd:nonNegativeInteger"
use="optional"/>
  </xsd:attributeGroup>


5.    Schema for XForms -

   <xsd:element name="group">
    <xsd:complexType>
      <xsd:sequence maxOccurs="unbounded">
        <xsd:element ref="xforms:caption" minOccurs="0"/>
        <xsd:any namespace="##any"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
      <xsd:attributeGroup ref="xforms:commonUIAttributes"/>
    </xsd:complexType>
  </xsd:element>

has an ambiguous content model. Some possible solutions;

a) Make caption mandatory ( minOccurs='1' )
b) Remove the reference to caption altogether ( content model would just
contain the wildcard ). c) Put in a choice listing all the xforms elements
that are valid, followed by a ##other wildcard. e.g.

   <xsd:element name="group">
    <xsd:complexType>
      <xsd:sequence maxOccurs="unbounded">
        <xsd:element ref="xforms:caption" minOccurs="0"/>
        <xsd:choice>
          <xsd:element ref='xforms:input' />
          <xsd:element ref='xforms:secret' />
          <xsd:element ref='xforms:textarea' />
          <!-- other xforms elements
        </xsd:choice>
        <xsd:any namespace="##other"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
      <xsd:attributeGroup ref="xforms:commonUIAttributes"/>
    </xsd:complexType>
  </xsd:element>

d) put all the elements in the choice above into a substitution group. Make
type of the head of the substitution group be the ur-type.

    <xsd:element name='XFormsHead' abstract='true' />
    <xsd:element name='input' substitutionGroup='xforms:XFormsHead' ...>
    ...
    </xsd:element>
    <!-- other xforms elements also use
substitutionGroup='xforms'XFormsHead' as appropriate -->


   <xsd:element name="group">
    <xsd:complexType>
      <xsd:sequence maxOccurs="unbounded">
        <xsd:element ref="xforms:caption" minOccurs="0"/>
        <xsd:element ref='xforms:XFormsHead' />
        <xsd:any namespace="##other"/>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attributeGroup ref="xforms:bindFirstAttributes"/>
      <xsd:attributeGroup ref="xforms:commonUIAttributes"/>
    </xsd:complexType>
  </xsd:element>


6.    Schema for XForms -

  <xsd:element name="model">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="xforms:instance" minOccurs="0"/>
        <xsd:element ref="xforms:schema" minOccurs="0"/>
        <xsd:sequence minOccurs="0" maxOccurs="unbounded">
          <xsd:choice>
            <xsd:element ref="xforms:submitInfo"/>
            <xsd:element ref="xforms:privacy"/>
            <xsd:element ref="xforms:bind"/>
            <xsd:element ref="xforms:action"/>
            <xsd:element ref="xforms:extension"/>
          </xsd:choice>
        </xsd:sequence>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attribute name="extensionFunctions" type="xforms:QNameList"
use="optional"/>
    </xsd:complexType>
  </xsd:element>

has a redundant sequence. Could be rewritten as;

  <xsd:element name="model">
    <xsd:complexType>
      <xsd:sequence>
        <xsd:element ref="xforms:instance" minOccurs="0"/>
        <xsd:element ref="xforms:schema" minOccurs="0"/>
        <xsd:choice minOccurs="0" maxOccurs="unbounded">
            <xsd:element ref="xforms:submitInfo"/>
            <xsd:element ref="xforms:privacy"/>
            <xsd:element ref="xforms:bind"/>
            <xsd:element ref="xforms:action"/>
            <xsd:element ref="xforms:extension"/>
        </xsd:choice>
      </xsd:sequence>
      <xsd:attributeGroup ref="xforms:horzAttrs"/>
      <xsd:attribute name="id" type="xsd:ID" use="optional"/>
      <xsd:attribute name="extensionFunctions" type="xforms:QNameList"
use="optional"/>
    </xsd:complexType>
  </xsd:element>


7.    Schema for XForms -

    All wildcards have processContents='strict' ( as this is the default
value ). Is this the intention? Or should they be marked
processContents='lax'?


8.    Schema for XForms -

    Many wildcards ( in schema, caption, hint, help, alert, extension, value
element decls ) are single occurence. While others ( in instance, group,
case, repeat element decls ) are unbounded. Is this correct? Or should they
all be unbounded?


9.    Schema for XForms -

    In all but two cases (extension and value), the ID attribute and the
horzAttrs AttributeGroup are used together.  Why not make an AttributeGroup
containing them?
Received on Thursday, 21 February 2002 14:14:15 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 10 June 2009 18:12:10 GMT