jeudi 24 mars 2016

XSD 1.1 assert if statement

Please can someone help me out with regards to validating against two elements (non attirbutes) whereby I would like to say:-

If PersonalIdentification = 00000000 then a valid DateofBirth must be entered.

Please please before I throw my computer out the window, can someone explain the type of :xsd:assert I need to insert and where?

here is my relatively simple xsd 1.1 snippet:-

    <xsd:complexType name="Personal">
    <xsd:annotation>
    <xsd:documentation xml:lang="en">blah blah</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
    <xsd:element name="Country" type="Country_Type minOccurs="0" maxOccurs="unbounded"/>
     <xsd:element name="PersonalIdentification" type="PI_Type" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="Name" type="Name_Type" maxOccurs="unbounded"/>
<xsd:element name="Address" type="Address_Type" maxOccurs="unbounded"/>
<xsd:element name="Nationality" type="Country_Type" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="BirthInfo" minOccurs="0">
 <xsd:complexType>
  <xsd:sequence>
    <xsd:element name="DateofBirth" type="xsd:date" minOccurs="0"/>
    <xsd:element name="City" type="xsd:string" minOccurs="0"/>
    <xsd:element name="Town" type="xsd:string" minOccurs="0"/>
    <xsd:element name="CountryInfo" minOccurs="0">
<xsd:complexType>                                   <xsd:choice>
    <xsd:element name="CountryCode" type="iso:CountryCode_Type"/>
    </xsd:choice>
     </xsd:complexType>
       </xsd:element>
      </xsd:sequence>
     </xsd:complexType>
     </xsd:element>
      </xsd:sequence>
</xsd:complexType>

Aucun commentaire:

Enregistrer un commentaire