W3C home > Mailing lists > Public > www-xml-schema-comments@w3.org > October to December 2002

Different elements depending on the value of an attribute

From: by way of <a.galmes@barcelo.com>
Date: Thu, 12 Dec 2002 07:24:45 -0700
Message-Id: <5.1.0.14.1.20021212072441.03840f30@localhost>
To: W3C XML Schema Comments list <www-xml-schema-comments@w3.org>
We have developed an XML application and now I'm trying to write an schema 
to validate the incoming requests. The problem is that I don't know if it 
is possible to write an schema reflecting the way we are working: we have a 
set of possible requests and then we send a response. The type of each 
request is set with the attribute "type", and depending of this type, the 
content of the request must be one or another. For example:
<request type="user data">
     <user_id>test</user_id>
     <password>1234</password>
</request>
<request type="users list">
     <country>SPAIN</country>
</request>

I can't find a way to define a suitable schema. Could someone help? thanks.
Received on Thursday, 12 December 2002 10:27:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Sunday, 6 December 2009 18:13:01 GMT