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.54Mb 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

Dead Money by Grant McCrea
The Boys Are Back in Town by Christopher Golden
Frame-Up by Gian Bordin
Norton, Andre - Novel 23 by The White Jade Fox (v1.0)
A Moment in the Sun by John Sayles
When You Were Mine by Rebecca Serle
Dark Desire by Shannan Albright