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
5.32Mb size Format: txt, pdf, ePub
ads

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
 
.

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

Other books

Tell Them Katy Did by Victor J. Banis
The Unbegotten by John Creasey
The Touch (Healer Series) by Rios, Allison
The Good Son by Michael Gruber
Finding Cassie Crazy by Jaclyn Moriarty
Reign of Iron by Angus Watson