Less formally, schemas are constructed by defining parent-child and sibling relationships [Jelliffe1999a]. However this means that DTDs, and similar derivatives, are unable to define (and hence constrain) the other kinds of relationships that exist amongst markup elements within a document.
As the XPath specification [XPath] shows, there are many possible kinds of relationship, known as 'axes'.
Validation using tree patterns is a two-step process: Both the candidate object selection, and the assertions can be defined in terms of XPath expressions.
More formally, the nodes and arcs within a graph of data can be traversed to both identify nodes, and then make assertions about the relationships of those nodes to others within the same graph.
Having highlighted the fact that the existing schema paradigm can only express constraints among data items in terms of the child and sibling axes, it is natural to consider whether an alternate paradigm might allow a schema author to exploit these additional relationships to define additional types of constraint amongst document elements.
Tree patterns do just that, and XPath provides a convenient syntax in which to express those patterns.
The open-source XSLT implementation is based around a core framework which is open for extension and customisation.
Yet the fundamental approach adopted by these languages does not diverge greatly from the DTD paradigm: the definition of schemas using regular grammars.
During the last few years a number of different XML schema languages have appeared as suggested replacements for the ageing Document Type Definition (DTD).
The majority of these have taken the basic premise of recasting DTD functionality in XML syntax with the addition, in some cases, of other features such as data typing, inheritance, etc [XMLSchema].
While XML does include an ID/IDREF mechanism which allows for cross-referencing between elements, and hence another form of relationships, it only weakly binds those elements.
There is no enforcement that an IDREF must point to an ID on a particular element type, simply that is must point to an existing ID, and further that all IDs must be unique.