Here is my XML file. This file has to be validated against the following conditions
- The child -> child1 -> parentData -> name element should be present in parent -> parent* -> name
- The total length (4 + 3 = 7 in this case) of the children of a particular parent (Parent 2) should be equal to the length element of that element
- If the part 4-6 of Parent2 is used by child1, no other child should use the same part of Parent2 and many more...
Please help me with how should I validate this XML file. I tried generating a XSD file from Visual Studio and was able to implement a unique constraint for the parent and child names.
<sample>
<parent>
<parent1>
<name>Parent 1</name>
<length>10</length>
</parent1>
<parent2>
<name>Parent 2</name>
<length>7</length>
</parent2>
<parent3>
<name>Parent 3</name>
<length>20</length>
</parent3>
</parent>
<child>
<child1>
<length>3</length>
<parentData>
<name>Parent 2</name>
<start>4</start>
<stop>6</stop>
</parentData>
</child1>
<child2>
<length>4</length>
<parentData>
<name>Parent 2</name>
<start>0</start>
<stop>3</stop>
</parentData>
</child2>
</child>
</sample>