W3C home > Mailing lists > Public > xmlschema-dev@w3.org > April 2003

XML Schema: Alternating "unbounded" elements

From: Mohan Raj <mohanrajd@hotmail.com>
Date: Thu, 17 Apr 2003 16:37:09 -0700
To: xmlschema-dev@w3.org
Message-ID: <BAY1-F45c6pT0giSftN0000f0b2@hotmail.com>


I am fairly new to XML and i searched through the archives but did not find 
any solution for this issue.

I am trying to define a schema that can validate the following XML document.

<record>
   <field1>
      <value>x
      </value>
   </field1>

   <field2>
      <value>x
      </value>
   </field2>

   <field1>
      <value>x
      </value>
   </field1>

   <field3>
      <value>x
      </value>
   </field3>

   <field2>
      <value>x
      </value>
   </field2>

...

</record>

i have a bunch of fields field1 through field10 and i can have multiple 
occurences of every field (maxOccurs = "unbounded") and they need not be in 
a sequence (i.e.
field1 occuring thrice followed by field2 occuring twice etc). these 
elements can alternate as shown above (in any order).

please provide a sample schema that can do something like this. i appreciate 
your help.

thanks
mohan


_________________________________________________________________
Help STOP SPAM with the new MSN 8 and get 2 months FREE*  
http://join.msn.com/?page=features/junkmail
Received on Thursday, 17 April 2003 19:57:03 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:36 GMT