I don't see the desired behaviour when validating an XMLObject using
validate(XMLOptions) method.
If the XMLObject contains 3 mandatory fields and the 2nd one is missing the
contents of the 3rd is not validated. Is this correct?
Here is a snippet of the relevant part of the schema. If the SICCode is not
given inside a Classification element then the contents of LACORSCode is
never validated. If I add in a SICCode then the LACORSCode is validated?
<xs:element name="Classification">
<xs:complexType>
<xs:sequence>
<xs:element name="BCLCode" type="xs:string">
</xs:element>
<xs:element name="SICCode">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]{5}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
<xs:element name="LACORSCode">
<xs:simpleType>
<xs:restriction base="xs:string">
<xs:pattern value="[0-9]{5}"/>
</xs:restriction>
</xs:simpleType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:element>
Another thing which I have noticed is if I have a mandatory element in the
schema and it is not present in the XML document then when I validate it I
get loads of messages saying
Expected element "the mandatory element" instead of "element A"
Expected element "the mandatory element" instead of "element B"
Expected element "the mandatory element" instead of "element C"
Expected element "the mandatory element" before the end of the content in
element......
Surely one message is sufficient that the mandatory element is missing? Is
there anyway of eliminating the redundant messages?
Thanks
Paul