t:person-name
t:person-name — Formats a personal name.
Synopsis
<xsl:template name="t:person-name">
<xsl:param name="style" as="xs:string"/>
</xsl:template>Description
This template formats a personal name according to the specified style.
This template must only be called when the current context item is a
personname. The personname element can be used
in two different ways, it can just contain the name:
|<personname>Norman Walsh</personname>
or it can contain the name with markup:
|<personname><givenname>Norman</givenname>
|<surname>Walsh</surname></personname>
How the name is formatted depends on which form of markup is used and which style is selected. Several styles are supported:
If the name contains no markup, it is simply formatted as is.
If the style is “
FAMILY-given”, it is formatted witht:person-name-family-givenand generally produces the family name in upper case followed by the given name. For example: “WALSH Norman”.If the style is “
last-first”, it is formatted witht:person-name-last-firstand generally produces the family name followed by the given name separated by a comma. For example: “Walsh, Norman”.If the style is “
first-last”, it is formatted witht:person-name-first-lastand generally produces the given name followed by the family name. For example: “Norman Walsh”.Any other value raises
dbe:INVALID-NAME-STYLE.
Historically, DocBook used firstname for the given name of a person.
In DocBook 5.1, the givenname element was introduced as an
alternative. The stylesheets treat them identically.
The stylesheets attempt to determine what style to use for each
personname:
First, by looking at that the
roleattribute on that element. If any of styles from the$v:personal-name-styleslist appear in the role, that style will be selected. (If more than one style appears, the results are undefined.)If the
personnamedoesn’t identify a style, and if it’s a child ofauthor,editor, orothercredit, theroleattirbute of its parent is inspected.If the
$personal-name-styleis defined, it is is selected.If a style still hasn’t been selected the style in the localization file is used.
Personal names are notoriously complicated (see Names). DocBook includes several tags for identifying parts of names:
firstnameorgivennamefor a given name,
surnamefor a family name,
lineagefor lineage (such as “Jr” or “III”),
honorificfor an honorific title (such as “Dr” or “Ms”), and
othernamefor everything else.
In all likelihood, if your document contains a variety of personal names, you will need to use roles to disambiguate special cases and you will have to provide alternate or additional templates to format them.