The concept of dependencies (which you call "binding") in XML is controlled through nesting. Therefore, if you want the two fields to depend on each other, you must define them as mandatory attributes of a nested, optional element.
So, if you have full control over the structure of the circuit, you can do something like this:
<customer id="1"> <contact city="Gotham" phone="batman red phone" /> </customer>
If the contact element is optional in customer , but city and phone are mandatory within contact .
The corresponding XSD for this structure would be something like this:
<xs:element name="customer"> <xs:complexType> <xs:sequence> <xs:element name="contact" minOccurs="0"> <xs:complexType> <xs:attribute name="city" type="xs:string" use="required"/> <xs:attribute name="phone" type="xs:string" use="required"/> </xs:complexType> </xs:element> </xs:sequence> <xs:attribute name="id" type="xs:string"/> </xs:complexType> </xs:element>
source share