Read XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition Online
Authors: Michael Kay
The template rule for the
The
id
and
name
attributes of the HTML
element are both used (by various browsers) to identify the element, and the
title
attribute identifies its role; it is not used by a conventional browser, but may be used, for example, by audio browsers.
The corresponding rule for the
This calls the named template
href.target
to produce the content of the
href
attribute. We've already seen this named template on page 1021. Note the use of the
key()
function to enable quick access to the target of the link: scanning the whole document, by using an expression such as
//termdef[@id=current()/@def]
, would be hopelessly slow unless you're lucky enough to be using a processor that optimizes the construct.
The other rules that generate internal links are all very similar to this pair.
The links to a section are a little more complex because they require the section number to be computed. In the source XML document, the links look like this:
Full definitions of the specific characters in each class
are given in