Name

t:person-name — Formats a personal name.

Template:
{http://docbook.org/ns/docbook/templates}person-name
Defined in:
modules/info.xsl
Used in:
modules/info.xsl

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:

  1. If the name contains no markup, it is simply formatted as is.

  2. If the style is “FAMILY-given”, it is formatted with t:person-name-family-given and generally produces the family name in upper case followed by the given name. For example: “WALSH Norman”.

  3. If the style is “last-first”, it is formatted with t:person-name-last-first and generally produces the family name followed by the given name separated by a comma. For example: “Walsh, Norman”.

  4. If the style is “first-last”, it is formatted with t:person-name-first-last and generally produces the given name followed by the family name. For example: “Norman Walsh”.

  5. Any other value raises dbe:INVALID-NAME-STYLE.

🛈︎
Given names

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:

  1. First, by looking at that the role attribute on that element. If any of styles from the $v:personal-name-styles list appear in the role, that style will be selected. (If more than one style appears, the results are undefined.)

  2. If the personname doesn’t identify a style, and if it’s a child of author, editor, or othercredit, the role attirbute of its parent is inspected.

  3. If a style still hasn’t been selected and the in-context language localization file contains a “personname” key, the value of that key is taken as the style.

  4. Failing all those options, the $default-personal-name-style is selected.

Personal names are notoriously complicated (see Names). DocBook includes several tags for identifying parts of names:

firstname or givenname

for a given name,

surname

for a family name,

lineage

for lineage (such as “Jr” or “III”),

honorific

for an honorific title (such as “Dr” or “Ms”), and

othername

for 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.