Assume that an answer element is defined in XSD:
<xs:element name="answer" minOccurs="1" maxOccurs="1"> <xs:complexType> <xs:attribute name="name" use="required"> <xs:simpleType> <xs:restriction base="answer"/> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element>
in the same document, we have the element 'language', defined as:
<xs:element name="language" minOccurs="1" maxOccurs="1"> <xs:complexType> <xs:attribute name="name" use="required"> <xs:simpleType> <xs:restriction base="answer"/> </xs:simpleType> </xs:attribute> </xs:complexType> </xs:element>
Both of them have an entry <xs:restriction base="answer"/> where "answer" is an enumeration of predefined values.
So, I need to check that if there is a βresponseβ node with the name = 'some_answer' there is also a 'response' node with the name = 'some_answer'
Example:
<answer name="some_answer"/> <language name="some_answer"/>
source share