BAG element

It will be great in the new specification to have a kind of bag element with
the following requirements

1. The order of the elements is not important
2. It can contains predefined elements that must occurs with a given
occurrences (min and max) 
3. It can also accepts any king of others elements (same or others
namespaces) using <xs:any> element. 

   <xs:element name="metadata">
      <xs:complexType>
         <xs:bag>
            <xs:element name="identifier" type="xs:string" minOccurs="1"
maxOccurs="1" />
            <xs:element name="subject" type="xs:string" minOccurs="0"
maxOccurs="1" />
            <xs:element name="name" type="xs:string" minOccurs="0"
maxOccurs="unbounded" />
            <xs:any processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
         </xs:bag>
      </xs:complexType>
   </xs:element>
   
Here is an instance example:

<metadata>
  <identifier>urn:hsc:1234</identifier>
  <name>Hess Yvan</name>
   <subject>this is the subject</subject>
   <name>Hess Yvan</name>
   <anyOtherElement>blabla</anyOtherElement>
</metadata>


With version 1.0, I tried many possible ways but I never success. I think I
reach a limitation of the W3C recommendation 1.0. I used for example:

   <xs:element name="metadata">
      <xs:complexType>
         <xs:sequence>
            <xs:element name="identifier" type="xs:string"/>
            <xs:any processContents="lax" minOccurs="0"
maxOccurs="unbounded"/>
         </xs:sequence>
      </xs:complexType>
   </xs:element>
   
But in this case it violates the "Unique Particle Attribution". From my
point of view this use case is a real concrete use case that should be
supported by W3C XML schema recommendation in a given way.


Yvan Hess
Chief Software Architect

e-mail: yvan.hess@imtf.ch
phone : +41 (0)26 460 66 66 
fax   : +41 (0)26 460 66 60 

Informatique-MTF SA
Route du Bleuet 1 
CH-1762 Givisiez 
        
Systemintegrators for eDocuments 
http://www.imtf.com

DISCLAIMER 
This message is intended only for use by the person to whom it is addressed.
It may contain information that is privileged and confidential. Its content
does not constitute a formal commitment by IMTF. If you are not the intended
recipient of this message, kindly notify the sender immediately and destroy
this message. Thank You.

Received on Friday, 12 March 2004 03:59:10 UTC