[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: at least one

From: George Cristian Bina <george@oxygenxml.com>
Date: Mon, 22 May 2006 17:30:42 +0300
Message-ID: <4471CB12.60008@oxygenxml.com>
To: Debora Vanni <debora.vanni@tvblob.com>
CC: xmlschema-dev@w3.org
Re: at least one

Hi Debora,

If you know all the elements that can go inside filters then you can 
just have a choice model group that contains all the elements and set 
the occurrence on the choice model group to one or more:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema">
   <xs:element name="filters">
     <xs:complexType>
       <xs:choice maxOccurs="unbounded">
         <xs:element name="high"/>
         <xs:element name="medium"/>
         <xs:element name="low"/>
       </xs:choice>
     </xs:complexType>
   </xs:element>
</xs:schema>

Best Regards,
George
---------------------------------------------------------------------
George Cristian Bina
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
http://www.oxygenxml.com


Debora Vanni wrote:
> Sorry to bother you again,
> I try to look around but I can't find a solution.
> I would like to know if there is some way in XSD to say that a complex
> element should be composed by any but at least one element of a group(=
> some) of elements.
> For example:
> the group is :
> 	<high></high>
> 	<medium></medium>
> 	<low></low>
> 
> This is CORRECT:
> <filters>
> 	<high></high>
> 	<medium></medium>
> 	<low></low>
> </filters>
> 
> This is CORRECT:
> <filters>
> 	<high></high>
> 	<low></low>
> </filters>
> 
> This is INCORRECT:
> <filters>
> 
> </filters>
> I know the maximum number of elements of the group but I don't know
> which and how many they could choose. Everything it's ok but there
> should be at least one!
> Thank you for you help
> Debora Vanni
> 
> 
> 
> 
Received on Monday, 22 May 2006 14:28:14 GMT

Subscribe to the Stylus Scoop newsletter for helpful XML tips and tutorials.
Email
First Name
Last Name
Company

Download Stylus Studio 6 XML Enterprise Edition

Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2007 All Rights Reserved.