Fw: Submission for next revision of XML Schema

Forwarding it since it didn't reach the comments list.





Steve Hanson/UK/IBM@IBMGB 
03/04/2005 05:49 AM

To
www-xml-schema-comments@w3.org
cc
Sandy Gao/Toronto/IBM
Subject
Submission for next revision of XML Schema





In addition to <sequence>, <choice> and <all> I would like to propose the 
following composition. 

<unorderedSet>. 
This is a similar to <all> but less restrictive. We have found this to be 
useful when modelling real-world messages. 

Rules: 
- You can define only local elements or element references as content, so 
no local groups or group references
- Elements can repeat, but can not be duplicated. 
- Child elements in the instance document can appear in any order but 
repeats must all be together.
- An unorderedSet can occur within a <sequence> or <choice>

Example valid schema: 

<xsd:complexType name="type1">
  <xsd:sequence>
    <xsd:unorderedSet>
        <xsd:element name="A"/>
        <xsd:element name="B" maxOccurs="4"/>
        <xsd:element name="C"/>
    </xsd:unorderedSet>
  </xsd:sequence>
</xsd:complexType>

Example valid instance documents:

      A,B,C 
      B,C,A 
      A,C,B 
      A,B,B,B,B,C
      B,B,A,C

Example invalid instance documents:

      A,B,C,B                                               <--- repeats 
not together

Example invalid schema: 

<xsd:complexType name="type2">
    <xsd:unorderedSet>
        <xsd:element name="A"/>
        <xsd:element name="B"/>
        <xsd:element name="C"/>
        <xsd:element name="B"/>                       <---- duplicate
    </xsd:unorderedSet>
</xsd:complexType>

<xsd:complexType name="type2">
    <xsd:unorderedSet>
        <xsd:element name="A"/>
        <xsd:element name="B"/>
        <xsd:element name="C"/>
        <xsd:sequence>                                         <---- not 
element content
                     <xsd:element name="Z"/>
                 </xsd:sequence>
    </xsd:unorderedSet>
</xsd:complexType>


Steve Hanson
WebSphere Business Integration Brokers, 
IBM Hursley, England
Internet: smh@uk.ibm.com
Phone (+44)/(0) 1962-815848

Received on Friday, 4 March 2005 15:46:37 UTC