make field mandatory depending on values
Posted: Thu Feb 15, 2018 7:48 am
Hi all,
could anybody plaese provide an example, how to make a parent element mandatory if one of its children has a special value?
e.g. how could I make element
if would be
Thanks Regards Mario
could anybody plaese provide an example, how to make a parent element mandatory if one of its children has a special value?
e.g. how could I make element
Code: Select all
name="book" = minOccurs = 1
Code: Select all
name="title"
Code: Select all
"The Hobbit"
Code: Select all
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<xsd:element name="catalog">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="book"
minOccurs="0"
maxOccurs="unbounded">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="author" type="xsd:string"/>
<xsd:element name="title" type="xsd:string"/>
</xsd:sequence>
<xsd:attribute name="id" type="xsd:string"/>
</xsd:complexType>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
</xsd:element>
</xsd:schema>