XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition (710 page)

BOOK: XSLT 2.0 and XPath 2.0 Programmer's Reference, 4th Edition
3.4Mb size Format: txt, pdf, ePub

The template rule for the

marks the definition as such, and generates an HTML anchor, like this:



  [

  

    Definition

  

  

  

  ]


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

element generates a link to this anchor:

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 .


Other books

Call of the White by Aston, Felicity
Sunrise on Cedar Key by Terri Dulong
More Than Kisses by Renee Ericson
The Dirty Book Murder by Thomas Shawver
Riotous Assembly by Tom Sharpe
The Place I Belong by Nancy Herkness
Breeders (Breeders #1) by Ashley Quigley
CASINO SHUFFLE by Fields Jr., J.
Lair of Killers by Will Molinar