+++ /dev/null
-<?xml version="1.0"?>\r
-\r
-<reference xml:id="base">\r
- <info>\r
- <title>Common » Base Template Reference</title>\r
- <releaseinfo role="meta">\r
- $Id: common.xsl 8274 2009-02-27 07:02:45Z bobstayton $\r
- </releaseinfo>\r
- </info>\r
- \r
- <partintro xml:id="partintro">\r
- <title>Introduction</title>\r
- \r
-<para>This is technical reference documentation for the “base”\r
- set of common templates in the DocBook XSL Stylesheets.</para>\r
-\r
- \r
-<para>This is not intended to be user documentation. It is\r
- provided for developers writing customization layers for the\r
- stylesheets.</para>\r
-\r
- </partintro>\r
-\r
-<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="template.is.component">\r
-<refnamediv>\r
-<refname>is.component</refname>\r
-<refpurpose>Tests if a given node is a component-level element</refpurpose>\r
-</refnamediv>\r
-<refsynopsisdiv>\r
-<synopsis><xsl:template name="is.component">\r
-<xsl:param name="node" select="."/>\r
- ...\r
-</xsl:template></synopsis>\r
-</refsynopsisdiv>\r
-<refsect1><title>Description</title>\r
-\r
-<para>This template returns '1' if the specified node is a component\r
-(Chapter, Appendix, etc.), and '0' otherwise.</para>\r
-\r
-</refsect1><refsect1><title>Parameters</title>\r
-\r
-<variablelist>\r
-<varlistentry><term>node</term>\r
-<listitem>\r
-\r
-<para>The node which is to be tested.</para>\r
-\r
-</listitem>\r
-</varlistentry>\r
-</variablelist>\r
-\r
-</refsect1><refsect1><title>Returns</title>\r
-\r
-<para>This template returns '1' if the specified node is a component\r
-(Chapter, Appendix, etc.), and '0' otherwise.</para>\r
-\r
-</refsect1></refentry>\r
-\r
-<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="template.is.section">\r
-<refnamediv>\r
-<refname>is.section</refname>\r
-<refpurpose>Tests if a given node is a section-level element</refpurpose>\r
-</refnamediv>\r
-<refsynopsisdiv>\r
-<synopsis><xsl:template name="is.section">\r
-<xsl:param name="node" select="."/>\r
- ...\r
-</xsl:template></synopsis>\r
-</refsynopsisdiv>\r
-<refsect1><title>Description</title>\r
-\r
-<para>This template returns '1' if the specified node is a section\r
-(Section, Sect1, Sect2, etc.), and '0' otherwise.</para>\r
-\r
-</refsect1><refsect1><title>Parameters</title>\r
-\r
-<variablelist>\r
-<varlistentry><term>node</term>\r
-<listitem>\r
-\r
-<para>The node which is to be tested.</para>\r
-\r
-</listitem>\r
-</varlistentry>\r
-</variablelist>\r
-\r
-</refsect1><refsect1><title>Returns</title>\r
-\r
-<para>This template returns '1' if the specified node is a section\r
-(Section, Sect1, Sect2, etc.), and '0' otherwise.</para>\r
-\r
-</refsect1></refentry>\r
-\r
-<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="template.section.level">\r
-<refnamediv>\r
-<refname>section.level</refname>\r
-<refpurpose>Returns the hierarchical level of a section</refpurpose>\r
-</refnamediv>\r
-<refsynopsisdiv>\r
-<synopsis><xsl:template name="section.level">\r
-<xsl:param name="node" select="."/>\r
- ...\r
-</xsl:template></synopsis>\r
-</refsynopsisdiv>\r
-<refsect1><title>Description</title>\r
-\r
-<para>This template calculates the hierarchical level of a section.\r
-The element <tag>sect1</tag> is at level 1, <tag>sect2</tag> is\r
-at level 2, etc.</para>\r
-\r
-\r
-\r
-<para>Recursive sections are calculated down to the fifth level.</para>\r
-\r
-</refsect1><refsect1><title>Parameters</title>\r
-\r
-<variablelist>\r
-<varlistentry><term>node</term>\r
-<listitem>\r
-\r
-<para>The section node for which the level should be calculated.\r
-Defaults to the context node.</para>\r
-\r
-</listitem>\r
-</varlistentry>\r
-</variablelist>\r
-\r
-</refsect1><refsect1><title>Returns</title>\r
-\r
-<para>The section level, <quote>1</quote>, <quote>2</quote>, etc.\r
-</para>\r
-\r
-</refsect1></refentry>\r
-\r
-<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="template.qanda.section.level">\r
-<refnamediv>\r
-<refname>qanda.section.level</refname>\r
-<refpurpose>Returns the hierarchical level of a QandASet</refpurpose>\r
-</refnamediv>\r
-<refsynopsisdiv>\r
-<synopsis><xsl:template name="qanda.section.level"/></synopsis>\r
-</refsynopsisdiv>\r
-<refsect1><title>Description</title>\r
-\r
-<para>This template calculates the hierarchical level of a QandASet.\r
-</para>\r
-\r
-</refsect1><refsect1><title>Returns</title>\r
-\r
-<para>The level, <quote>1</quote>, <quote>2</quote>, etc.\r
-</para>\r
-\r
-</refsect1></refentry>\r
-\r
-<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="template.select.mediaobject">\r
-<refnamediv>\r
-<refname>select.mediaobject</refname>\r
-<refpurpose>Selects and processes an appropriate media object from a list</refpurpose>\r
-</refnamediv>\r
-<refsynopsisdiv>\r
-<synopsis><xsl:template name="select.mediaobject">\r
-<xsl:param name="olist" select="imageobject|imageobjectco |videoobject|audioobject|textobject"/>\r
- ...\r
-</xsl:template></synopsis>\r
-</refsynopsisdiv>\r
-<refsect1><title>Description</title>\r
-\r
-<para>This template takes a list of media objects (usually the\r
-children of a mediaobject or inlinemediaobject) and processes\r
-the "right" object.</para>\r
-\r
-\r
-\r
-<para>This template relies on a template named \r
-"select.mediaobject.index" to determine which object\r
-in the list is appropriate.</para>\r
-\r
-\r
-\r
-<para>If no acceptable object is located, nothing happens.</para>\r
-\r
-</refsect1><refsect1><title>Parameters</title>\r
-\r
-<variablelist>\r
-<varlistentry><term>olist</term>\r
-<listitem>\r
-\r
-<para>The node list of potential objects to examine.</para>\r
-\r
-</listitem>\r
-</varlistentry>\r
-</variablelist>\r
-\r
-</refsect1><refsect1><title>Returns</title>\r
-\r
-<para>Calls <xsl:apply-templates> on the selected object.</para>\r
-\r
-</refsect1></refentry>\r
-\r
-<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="template.select.mediaobject.index">\r
-<refnamediv>\r
-<refname>select.mediaobject.index</refname>\r
-<refpurpose>Selects the position of the appropriate media object from a list</refpurpose>\r
-</refnamediv>\r
-<refsynopsisdiv>\r
-<synopsis><xsl:template name="select.mediaobject.index">\r
-<xsl:param name="olist" select="imageobject|imageobjectco |videoobject|audioobject|textobject"/>\r
-<xsl:param name="count">1</xsl:param>\r
- ...\r
-</xsl:template></synopsis>\r
-</refsynopsisdiv>\r
-<refsect1><title>Description</title>\r
-\r
-<para>This template takes a list of media objects (usually the\r
-children of a mediaobject or inlinemediaobject) and determines\r
-the "right" object. It returns the position of that object\r
-to be used by the calling template.</para>\r
-\r
-\r
-\r
-<para>If the parameter <parameter>use.role.for.mediaobject</parameter>\r
-is nonzero, then it first checks for an object with\r
-a role attribute of the appropriate value. It takes the first\r
-of those. Otherwise, it takes the first acceptable object\r
-through a recursive pass through the list.</para>\r
-\r
-\r
-\r
-<para>This template relies on a template named "is.acceptable.mediaobject"\r
-to determine if a given object is an acceptable graphic. The semantics\r
-of media objects is that the first acceptable graphic should be used.\r
-</para>\r
-\r
-\r
-\r
-<para>If no acceptable object is located, no index is returned.</para>\r
-\r
-</refsect1><refsect1><title>Parameters</title>\r
-\r
-<variablelist>\r
-<varlistentry><term>olist</term>\r
-<listitem>\r
-\r
-<para>The node list of potential objects to examine.</para>\r
-\r
-</listitem>\r
-</varlistentry>\r
-<varlistentry><term>count</term>\r
-<listitem>\r
-\r
-<para>The position in the list currently being considered by the \r
-recursive process.</para>\r
-\r
-</listitem>\r
-</varlistentry>\r
-</variablelist>\r
-\r
-</refsect1><refsect1><title>Returns</title>\r
-\r
-<para>Returns the position in the original list of the selected object.</para>\r
-\r
-</refsect1></refentry>\r
-\r
-<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="template.is.acceptable.mediaobject">\r
-<refnamediv>\r
-<refname>is.acceptable.mediaobject</refname>\r
-<refpurpose>Returns '1' if the specified media object is recognized</refpurpose>\r
-</refnamediv>\r
-<refsynopsisdiv>\r
-<synopsis><xsl:template name="is.acceptable.mediaobject">\r
-<xsl:param name="object"/>\r
- ...\r
-</xsl:template></synopsis>\r
-</refsynopsisdiv>\r
-<refsect1><title>Description</title>\r
-\r
-<para>This template examines a media object and returns '1' if the\r
-object is recognized as a graphic.</para>\r
-\r
-</refsect1><refsect1><title>Parameters</title>\r
-\r
-<variablelist>\r
-<varlistentry><term>object</term>\r
-<listitem>\r
-\r
-<para>The media object to consider.</para>\r
-\r
-</listitem>\r
-</varlistentry>\r
-</variablelist>\r
-\r
-</refsect1><refsect1><title>Returns</title>\r
-\r
-<para>0 or 1</para>\r
-\r
-</refsect1></refentry>\r
-\r
-<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="template.check.id.unique">\r
-<refnamediv>\r
-<refname>check.id.unique</refname>\r
-<refpurpose>Warn users about references to non-unique IDs</refpurpose>\r
-</refnamediv>\r
-<refsynopsisdiv>\r
-<synopsis><xsl:template name="check.id.unique">\r
-<xsl:param name="linkend"/>\r
- ...\r
-</xsl:template></synopsis>\r
-</refsynopsisdiv>\r
-<refsect1><title>Description</title>\r
-\r
-<para>If passed an ID in <varname>linkend</varname>,\r
-<function>check.id.unique</function> prints\r
-a warning message to the user if either the ID does not exist or\r
-the ID is not unique.</para>\r
-\r
-</refsect1></refentry>\r
-\r
-<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="template.check.idref.targets">\r
-<refnamediv>\r
-<refname>check.idref.targets</refname>\r
-<refpurpose>Warn users about incorrectly typed references</refpurpose>\r
-</refnamediv>\r
-<refsynopsisdiv>\r
-<synopsis><xsl:template name="check.idref.targets">\r
-<xsl:param name="linkend"/>\r
-<xsl:param name="element-list"/>\r
- ...\r
-</xsl:template></synopsis>\r
-</refsynopsisdiv>\r
-<refsect1><title>Description</title>\r
-\r
-<para>If passed an ID in <varname>linkend</varname>,\r
-<function>check.idref.targets</function> makes sure that the element\r
-pointed to by the link is one of the elements listed in\r
-<varname>element-list</varname> and warns the user otherwise.</para>\r
-\r
-</refsect1></refentry>\r
-\r
-<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="template.copyright.years">\r
-<refnamediv>\r
-<refname>copyright.years</refname>\r
-<refpurpose>Print a set of years with collapsed ranges</refpurpose>\r
-</refnamediv>\r
-<refsynopsisdiv>\r
-<synopsis><xsl:template name="copyright.years">\r
-<xsl:param name="years"/>\r
-<xsl:param name="print.ranges" select="1"/>\r
-<xsl:param name="single.year.ranges" select="0"/>\r
-<xsl:param name="firstyear" select="0"/>\r
-<xsl:param name="nextyear" select="0"/>\r
- ...\r
-</xsl:template></synopsis>\r
-</refsynopsisdiv>\r
-<refsect1><title>Description</title>\r
-\r
-<para>This template prints a list of year elements with consecutive\r
-years printed as a range. In other words:</para>\r
-\r
-\r
-<screen><year>1992</year>\r
-<year>1993</year>\r
-<year>1994</year></screen>\r
-\r
-\r
-<para>is printed <quote>1992-1994</quote>, whereas:</para>\r
-\r
-\r
-<screen><year>1992</year>\r
-<year>1994</year></screen>\r
-\r
-\r
-<para>is printed <quote>1992, 1994</quote>.</para>\r
-\r
-\r
-\r
-<para>This template assumes that all the year elements contain only\r
-decimal year numbers, that the elements are sorted in increasing\r
-numerical order, that there are no duplicates, and that all the years\r
-are expressed in full <quote>century+year</quote>\r
-(<quote>1999</quote> not <quote>99</quote>) notation.</para>\r
-\r
-</refsect1><refsect1><title>Parameters</title>\r
-\r
-<variablelist>\r
-<varlistentry><term>years</term>\r
-<listitem>\r
-\r
-<para>The initial set of year elements.</para>\r
-\r
-</listitem>\r
-</varlistentry>\r
-<varlistentry><term>print.ranges</term>\r
-<listitem>\r
-\r
-<para>If non-zero, multi-year ranges are collapsed. If zero, all years\r
-are printed discretely.</para>\r
-\r
-</listitem>\r
-</varlistentry>\r
-<varlistentry><term>single.year.ranges</term>\r
-<listitem>\r
-\r
-<para>If non-zero, two consecutive years will be printed as a range,\r
-otherwise, they will be printed discretely. In other words, a single\r
-year range is <quote>1991-1992</quote> but discretely it's\r
-<quote>1991, 1992</quote>.</para>\r
-\r
-</listitem>\r
-</varlistentry>\r
-</variablelist>\r
-\r
-</refsect1><refsect1><title>Returns</title>\r
-\r
-<para>This template returns the formatted list of years.</para>\r
-\r
-</refsect1></refentry>\r
-\r
-<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="template.find.path.params">\r
-<refnamediv>\r
-<refname>find.path.params</refname>\r
-<refpurpose>Search in a table for the "best" match for the node</refpurpose>\r
-</refnamediv>\r
-<refsynopsisdiv>\r
-<synopsis><xsl:template name="find.path.params">\r
-<xsl:param name="node" select="."/>\r
-<xsl:param name="table" select="''"/>\r
-<xsl:param name="location">\r
- <xsl:call-template name="xpath.location">\r
- <xsl:with-param name="node" select="$node"/>\r
- </xsl:call-template>\r
- </xsl:param>\r
- ...\r
-</xsl:template></synopsis>\r
-</refsynopsisdiv>\r
-<refsect1><title>Description</title>\r
-\r
-<para>This template searches in a table for the value that most-closely\r
-(in the typical best-match sense of XSLT) matches the current (element)\r
-node location.</para>\r
-\r
-</refsect1></refentry>\r
-\r
-<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="template.string.upper">\r
-<refnamediv>\r
-<refname>string.upper</refname>\r
-<refpurpose>Converts a string to all uppercase letters</refpurpose>\r
-</refnamediv>\r
-<refsynopsisdiv>\r
-<synopsis><xsl:template name="string.upper">\r
-<xsl:param name="string" select="''"/>\r
- ...\r
-</xsl:template></synopsis>\r
-</refsynopsisdiv>\r
-<refsect1><title>Description</title>\r
-\r
-<para>Given a string, this template does a language-aware conversion\r
-of that string to all uppercase letters, based on the values of the\r
-<literal>lowercase.alpha</literal> and\r
-<literal>uppercase.alpha</literal> gentext keys for the current\r
-locale. It affects only those characters found in the values of\r
-<literal>lowercase.alpha</literal> and\r
-<literal>uppercase.alpha</literal>. All other characters are left\r
-unchanged.</para>\r
-\r
-</refsect1><refsect1><title>Parameters</title>\r
-\r
-<variablelist>\r
-<varlistentry><term>string</term>\r
-<listitem>\r
-\r
-<para>The string to convert to uppercase.</para>\r
-\r
-</listitem>\r
-</varlistentry>\r
-</variablelist>\r
-\r
-</refsect1></refentry>\r
-\r
-<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="template.string.lower">\r
-<refnamediv>\r
-<refname>string.lower</refname>\r
-<refpurpose>Converts a string to all lowercase letters</refpurpose>\r
-</refnamediv>\r
-<refsynopsisdiv>\r
-<synopsis><xsl:template name="string.lower">\r
-<xsl:param name="string" select="''"/>\r
- ...\r
-</xsl:template></synopsis>\r
-</refsynopsisdiv>\r
-<refsect1><title>Description</title>\r
-\r
-<para>Given a string, this template does a language-aware conversion\r
-of that string to all lowercase letters, based on the values of the\r
-<literal>uppercase.alpha</literal> and\r
-<literal>lowercase.alpha</literal> gentext keys for the current\r
-locale. It affects only those characters found in the values of\r
-<literal>uppercase.alpha</literal> and\r
-<literal>lowercase.alpha</literal>. All other characters are left\r
-unchanged.</para>\r
-\r
-</refsect1><refsect1><title>Parameters</title>\r
-\r
-<variablelist>\r
-<varlistentry><term>string</term>\r
-<listitem>\r
-\r
-<para>The string to convert to lowercase.</para>\r
-\r
-</listitem>\r
-</varlistentry>\r
-</variablelist>\r
-\r
-</refsect1></refentry>\r
-\r
-<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="template.select.choice.separator">\r
-<refnamediv>\r
-<refname>select.choice.separator</refname>\r
-<refpurpose>Returns localized choice separator</refpurpose>\r
-</refnamediv>\r
-<refsynopsisdiv>\r
-<synopsis><xsl:template name="select.choice.separator"/></synopsis>\r
-</refsynopsisdiv>\r
-<refsect1><title>Description</title>\r
- \r
-<para>This template enables auto-generation of an appropriate\r
- localized "choice" separator (for example, "and" or "or") before\r
- the final item in an inline list (though it could also be useful\r
- for generating choice separators for non-inline lists).</para>\r
-\r
- \r
-<para>It currently works by evaluating a processing instruction\r
- (PI) of the form <?dbchoice choice="foo"?> :\r
- \r
-<itemizedlist>\r
- <listitem>\r
- <simpara>if the value of the <tag>choice</tag>\r
- pseudo-attribute is "and" or "or", returns a localized "and"\r
- or "or"</simpara>\r
- </listitem>\r
- <listitem>\r
- <simpara>otherwise returns the literal value of the\r
- <tag>choice</tag> pseudo-attribute</simpara>\r
- </listitem>\r
- </itemizedlist>\r
-\r
- The latter is provided only as a temporary workaround because the\r
- locale files do not currently have translations for the word\r
- <wordasword>or</wordasword>. So if you want to generate a a\r
- logical "or" separator in French (for example), you currently need\r
- to do this:\r
- <literallayout><?dbchoice choice="ou"?></literallayout>\r
- </para>\r
-\r
- <warning>\r
- \r
-<para>The <tag>dbchoice</tag> processing instruction is\r
- an unfortunate hack; support for it may disappear in the future\r
- (particularly if and when a more appropriate means for marking\r
- up "choice" lists becomes available in DocBook).</para>\r
-\r
- </warning>\r
- </refsect1></refentry>\r
-\r
-<refentry xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="template.evaluate.info.profile">\r
-<refnamediv>\r
-<refname>evaluate.info.profile</refname>\r
-<refpurpose>Evaluates an info profile</refpurpose>\r
-</refnamediv>\r
-<refsynopsisdiv>\r
-<synopsis><xsl:template name="evaluate.info.profile">\r
-<xsl:param name="profile"/>\r
-<xsl:param name="info"/>\r
- ...\r
-</xsl:template></synopsis>\r
-</refsynopsisdiv>\r
-<refsect1><title>Description</title>\r
- \r
-<para>This template evaluates an "info profile" matching the XPath\r
- expression given by the <parameter>profile</parameter>\r
- parameter. It relies on the XSLT <function>evaluate()</function>\r
- extension function.</para>\r
-\r
-\r
- \r
-<para>The value of the <parameter>profile</parameter> parameter\r
- can include the literal string <literal>$info</literal>. If found\r
- in the value of the <parameter>profile</parameter> parameter, the\r
- literal string <literal>$info</literal> string is replaced with\r
- the value of the <parameter>info</parameter> parameter, which\r
- should be a set of <replaceable>*info</replaceable> nodes; the\r
- expression is then evaluated using the XSLT\r
- <function>evaluate()</function> extension function.</para>\r
-\r
- </refsect1><refsect1><title>Parameters</title>\r
- \r
-<variablelist>\r
- <varlistentry>\r
- <term>profile</term>\r
- <listitem>\r
- \r
-<para>A string representing an XPath expression </para>\r
-\r
- </listitem>\r
- </varlistentry>\r
- <varlistentry>\r
- <term>info</term>\r
- <listitem>\r
- \r
-<para>A set of *info nodes</para>\r
-\r
- </listitem>\r
- </varlistentry>\r
- </variablelist>\r
-\r
- </refsect1><refsect1><title>Returns</title>\r
- \r
-<para>Returns a node (the result of evaluating the\r
- <parameter>profile</parameter> parameter)</para>\r
-\r
- </refsect1></refentry>\r
-</reference>\r
-\r