|
[XMLSCHEMA-DEV Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] conditional occurrences of child elements
From: <jozef.aerts@xml4pharma.com>
Date: Tue, 9 Nov 2004 18:24:01 +0100 To: <xmlschema-dev@w3.org> Message-Id: <27999199$11000205824190fb66d77262.46940750@config17.schlund.de> 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 AertsReceived on Tuesday, 9 November 2004 17:36:41 GMT |
Subscribe in XML format
|






