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

Re: conditional occurrences of child elements

From: George Cristian Bina <george@oxygenxml.com>
Date: Wed, 10 Nov 2004 14:41:54 +0200
Message-ID: <41920C92.10000@oxygenxml.com>
To: jozef.aerts@xml4pharma.com
Cc: xmlschema-dev@w3.org
xsd conditional child

Hi Josef,

No, that is not possible in XML Schema.

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


jozef.aerts@xml4pharma.com wrote:
> Is it possible in XML-Schema to define the number of occurrences of an
> element on the value of an attribute of its parent element ?
> 
> For example:
> I have a parent element with name Person and attribute Gender.
> Gender can only have the values 'Male' or 'Female'.
> No problem sofar.
> Now I want to define a subelement 'Pregant' of 'Person'.
> The element 'Pregnant' should have no occurrences if the value of its
> parent element attribute 'Gender' is 'Male'.
> The element 'Pregnant' should have 1 occurrence if the value of its
> parent element attribute 'Gender' is 'Female'.
> 
> Is it possible to define something like this in XML-Schema ?
> 
> Best regards
> 
> Jozef Aerts
> 
Received on Wednesday, 10 November 2004 12:39:49 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.