Validating the child's age against the parents age in xsd

gasa87

New Member
I have an xml like below\[code\]<parents> <mother name="MMM" age="55" /> <children> <child name="CCC" gender="male" age="25" /> </children></parents>\[/code\]To validate mother's age or Child's age we can write the xsd like below\[code\]<xs:element name="mother"> <xs:complexType> <xs:attribute name="name" type="xs:string"/> <xs:attribute name="age"> <xs:simpleType> <xs:restriction base="xs:integer"> <xs:minInclusive value="http://stackoverflow.com/questions/11262915/0"/> <xs:maxInclusive value="http://stackoverflow.com/questions/11262915/120"/> </xs:restriction> </xs:simpleType> </xs:attribute> </xs:complexType></xs:element>\[/code\]But If I want to validate the child's age, which should not be more than mother's age?
 
Back
Top