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

At least 1 element out of 4 is required

From: Camilla Brenchley <cbrenchley@transhotel.com>
Date: Thu, 31 Jul 2003 16:32:01 +0200
To: <xmlschema-dev@w3.org>
Message-ID: <JKEGLBMFMFBPIFCOOHHJKEFDCAAA.cbrenchley@transhotel.com>

Hi there,

I have a XML doc that looks like this:

<?xml version=\"1.0\" encoding=\"iso-8859-1\"?>
<Location>
   <country>some country</country>
   <area>some area</area>
   <city>some city</city>
   <hotel>some hotel</hotel>
</Location>

I need to write an xml schema that checks that at least one of "Location"'s
four children (country, area, city, hotel) is present. I don't care which
one as long as one of them is there. The order of the child elements doesn't
matter.

I have searched and searched, and I'm almost beginning to believe this isn't
possible... Surely that's not the case?
Any help would be greatly appreciated.
Thanks in advance.

Regards,
Camilla
Received on Thursday, 31 July 2003 10:38:44 GMT

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