get.refentry.metadata
Prev | Common » Refentry Metadata Template Reference | Next

## get.refentry.metadata

get.refentry.metadata — Gathers metadata from a refentry and its ancestors

## Synopsis

    <xsl:template name="get.refentry.metadata">
    <xsl:param name="refname"/>
    <xsl:param name="info"/>
    <xsl:param name="prefs"/>
      ...
    </xsl:template>

##

Reference documentation for particular commands, functions, etc., is sometimes viewed in isolation from its greater "context". For example, users view Unix man pages as, well, individual pages, not as part of a "book" of some kind. Therefore, it is sometimes necessary to embed "context" information in output for each `refentry`.

However, one problem is that different users mark up that context information in different ways. Often (usually), the context information is not actually part of the content of the `refentry` itself, but instead part of the content of a parent or ancestor element to the the `refentry`. And even then, DocBook provides a variety of elements that users might potentially use to mark up the same kind of information. One user might use the `productnumber` element to mark up version information about a particular product, while another might use the `releaseinfo` element.

Taking all that in mind, the `get.refentry.metadata` template tries to gather metadata from a `refentry` element and its ancestor elements in an intelligent and user-configurable way. The basic mechanism used in the XPath expressions throughout this stylesheet is to select the relevant metadata from the *info element that is closest to the actual `refentry` – either on the `refentry` itself, or on its nearest ancestor.

### Note

The `get.refentry.metadata` template is actually just sort of a "driver" template; it calls other templates that do the actual data collection, then returns the data as a set.

## Parameters

refname

  The first `refname` in the refentry

info

  A set of info nodes (from a `refentry` element and its ancestors)

prefs

  A node containing user preferences (from global stylesheet parameters)

## Returns

Returns a node set with the following elements. The descriptions are verbatim from the `man(7)` man page.

title

  the title of the man page (e.g., `MAN`)

section

  the section number the man page should be placed in (e.g., `7`)

date

  the date of the last revision

source

  the source of the command

manual

  the title of the manual (e.g., Linux Programmer's Manual)

Prev | Up | Next
Common » Refentry Metadata Template Reference | Home | get.refentry.title