W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2002

How to Provide default elements in XMLSchema differentiated with attribute values

From: Rajan Gupta <rgupta99_1999@yahoo.com>
Date: Tue, 22 Jan 2002 17:48:05 -0800 (PST)
Message-ID: <20020123014805.65325.qmail@web11001.mail.yahoo.com>
To: xmlschema-dev@w3.org
I want to create a schema which enforces that an element with different
values has to be present in the instance of an XML document. e.g.
 
I want the following elements to be part of the schema always:
<FoodItems>
  <!-- The following 2 elements have to be there in an XML document -->
  <Liquid name="water">
     <qty>100</qty>
  </Liquid>
  <Liquid name="milk">
     <qty>50</qty>
  </Liquid>
  <!-- The following could be optionally there too -->
  <Liquid name="coke">
     <qty>10</qty>
  </Liquid>
</FoodItems>
I can write an XMLSchema for Liquids, but how do I enforce that elements
with water & milk as attribute values are present every time an instanc
document is created of the schema.
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Send FREE video emails in Yahoo! Mail!
> http://promo.yahoo.com/videomail/
> 
> ---------------------------------------------------------------------
> In case of troubles, e-mail:     webmaster@xml.apache.org
> To unsubscribe, e-mail:          general-unsubscribe@xml.apache.org
> For additional commands, e-mail: general-help@xml.apache.org
> 


__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/
Received on Tuesday, 22 January 2002 20:48:06 GMT

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