Complex Types
Compared with XSD, RELAX NG does not support simpleType and complexType tags. However, you can build complex types by grouping the named patterns define and ref. For example, complexType studentRoll can be built using references to studentID and studentSSN:
<start>
<oneOrMore>
<element name="studentRoll">
<ref name="studentID "/>
<ref ssn="studentSSN "/>
</element>
</oneOrMore>
</start>
Sequence Tag
By default, XSD defines the complex type elements in ordered sequence. XML tools on the market such as XMLSpy, 4Suite, and Stylus use the sequence tag to mandate that the elements within a complex type be ordered in sequence. As a result, though you define all the sub-elements, they must be in the order specified in the schema. This limits the full features of inheritance, because it restricts the definition of a subset of elements and what can be inherited from it. RELAX NG relaxes this restriction by providing the interleave tag:
<start>
<element name="parentNames">
<interleave>
<element name="motherName"><text/></element>
<optional>
<element name="fatherName"><text/></element>
</optional>
</interleave>
</element>
</start>
The above schema specifies that the parentNames can be interleaved, so mother's name or the optional father's name need not follow the order specified in the schema.