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

Other books

Now and Forever by April King
On the Back Burner by Diane Muldrow
Reliable Essays by Clive James
Wool: A Parody by Howey, Woolston
Covert Christmas by Marilyn Pappano
Tough Love by Kerry Katona
The Green Hills of Home by Bennet, Emma
The Family by Martina Cole
Dream of Me by Delilah Devlin