conditional element in schema

0 views
Skip to first unread message

shradha...@googlemail.com

unread,
Oct 10, 2008, 6:24:30 AM10/10/08
to XMLmodeling
Hi,

I need to do something like this in my schema difination

<xsd:element name="married">
<xsd:simpleType base="xsd:string">
<xsd:enumeration value="yes"/>
<xsd:enumeration value="no"/>
</xsd:simpleType>
</xsd:element>
<xsd:element name="dateofwedding"
type="xsd:date" condition="if married=yes" then="minOccurs="0""
else="minOccurs="1"")/>


Basically I need to make a conditional element which will be option or
mandatory based on the value of other element.

Do anybody have a valid example to compile with my requirements.

Thanks
Amit

Reply all
Reply to author
Forward
0 new messages