Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
Making Cross-References
If you read W3C working drafts and recommendations online, you'll notice that they are very heavily hyperlinked. Terms with special meanings are linked to their definitions; cross-references from one section of the specification to another are represented by hyperlinks; references to other documents are represented first by a link to the bibliography and then from the bibliography to the external document on the Web if it is available; there are references from a document to previous versions of the document, and so on. In the XML specification, every use of a grammar symbol such as
elementdecl
is linked to the grammar rule where it is defined. Similarly, in the XSLT specification, every use of an XSLT element name such as
xsl:sequence
is linked to its definition. In this section, we will look at the rules that are used to create these links. There are many of these, and I'll pick a selection that illustrates the techniques used.
Let's take the linking of term references to term definitions. Here is an example of a term definition from the XML specification that defines one term and contains two references to terms defined elsewhere in the specification:
formed, as defined in this specification. A well-formed XML document
may in addition be
further constraints.
(A curious definition, because having said that all XML documents are well-formed, it seems rather odd to use the phrase
well-formed XML document
in the very next sentence, as if there were any other kind. But we are not here to criticize the prose.)
The
id
attribute identifies this term definition uniquely within the document. The
term
attribute is the term being defined. This is also tagged using the
element, called the
appears in the
any other element.
I'm afraid I've never been sure as to whether the term being defined here is
root
or
root element
.
The
def
attribute that must match the
id
attribute of some