The example of X-definition with groups and "Family" version of data.
X-definition
<xd:def xmlns:xd="http://www.xdef.org/xdef/4.2" root="Family | Owner"> <Family> <Father xd:script="optional; ref Person;" /> <Mother xd:script="required; ref Person;" /> <xd:mixed> <Son xd:script="occurs *; ref Person;" /> <Daughter xd:script="occurs *; ref Person;" /> </xd:mixed> <Address xd:script="ref Address;" /> </Family> <Owner> <xd:choice> <Person xd:script="ref Person;" /> <Company name="string();" /> </xd:choice> <Address xd:script="ref Address;" /> </Owner> <Person Firstname="string();" Familyname="string();" BirthDate="date();" /> <Address Street = "string(1,30)" Number = "optional int()" City = "string()" /> </xd:def>
Input data
<Family> <Father Firstname = "John" Familyname = "Smith" BirthDate = "1971-07-13" /> <Mother Firstname = "Jane" Familyname = "Smith" BirthDate = "1972-09-18" /> <Son Firstname = "Peter" Familyname = "Smith" BirthDate = "1997-01-18" /> <Daughter Firstname = "Mary" Familyname = "Smith" BirthDate = "1998-12-11" /> <Address Street="Downing" Number="10" City="London"/> </Family>
You can edit both
X-definition
and/or
Input data