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
12.15Mb 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

The 6th Target by James Patterson, Maxine Paetro
To Love and Serve by Caridad Piñeiro
Bedding the Enemy by Mary Wine
Paradigm (9781909490406) by Lowe, Ceri A.
The Last Straw by Paul Gitsham
Notes from An Alien by Alexander M Zoltai
Dark Matter by Blake Crouch
Operation Napoleon by Arnaldur Indriðason