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

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

The template starts by locating the

element in which this person appears as a child. It does this using the
family-of-child
key defined earlier. Then it selects the

records for the father and mother, these being the records pointed to by the

and

fields of the

record: this time the
indi
key is used.

If the data is not all present, for example if there is no

element, or if the

is missing a

and

(no pedigree goes back to infinity), then the
$father
and or
$mother
variables will simply identify an empty sequence. The subsequent

instructions ensure that when this happens, the relevant label is omitted from the output.

The actual hyperlinks are generated by using

with
mode=“link”
: this gets reused for all the other links on the page, and we'll see later how it works. The
 
character reference outputs a nonbreaking space. It's actually simpler to do this than to output an ordinary space, which would require an

element. If you don't like numeric character references you can define an entity called
nbsp
in the

declaration and then use
 
in place of
 
.

Other books

Filthy Gorgeous by Knight, Jodi
Bones of the Dragon by Margaret Weis
If Wishes Were Earls by Elizabeth Boyle
Sagaria by John Dahlgren
June by Lori Copeland
The Disappearing Dwarf by James P. Blaylock