|
@@ -11,8 +11,8 @@
|
|
********************************************************************
|
|
********************************************************************
|
|
|
|
|
|
This file is part of the XSL DocBook Stylesheet distribution.
|
|
This file is part of the XSL DocBook Stylesheet distribution.
|
|
- See ../README or http://nwalsh.com/docbook/xsl/ for copyright
|
|
|
|
- and other information.
|
|
|
|
|
|
+ See ../README or http://docbook.sf.net/release/xsl/current/ for
|
|
|
|
+ copyright and other information.
|
|
|
|
|
|
This file contains general templates common to both the HTML and FO
|
|
This file contains general templates common to both the HTML and FO
|
|
versions of the DocBook stylesheets.
|
|
versions of the DocBook stylesheets.
|
|
@@ -25,7 +25,7 @@ $Id$
|
|
</releaseinfo>
|
|
</releaseinfo>
|
|
<author><surname>Walsh</surname>
|
|
<author><surname>Walsh</surname>
|
|
<firstname>Norman</firstname></author>
|
|
<firstname>Norman</firstname></author>
|
|
-<copyright><year>1999</year><year>2000</year>
|
|
|
|
|
|
+<copyright><year>1999-2007</year>
|
|
<holder>Norman Walsh</holder>
|
|
<holder>Norman Walsh</holder>
|
|
</copyright>
|
|
</copyright>
|
|
</referenceinfo>
|
|
</referenceinfo>
|
|
@@ -34,17 +34,16 @@ $Id$
|
|
<partintro id="partintro">
|
|
<partintro id="partintro">
|
|
<title>Introduction</title>
|
|
<title>Introduction</title>
|
|
|
|
|
|
-<para>This is technical reference documentation for the DocBook XSL
|
|
|
|
-Stylesheets; it documents (some of) the parameters, templates, and
|
|
|
|
-other elements of the stylesheets.</para>
|
|
|
|
|
|
+<para>This is technical reference documentation for the “common”
|
|
|
|
+templates in the DocBook XSL Stylesheets. The common templates are
|
|
|
|
+“common” because they are shared across output formats (that is,
|
|
|
|
+they’re not output-format-dependent).</para>
|
|
|
|
|
|
-<para>This is not intended to be <quote>user</quote> documentation.
|
|
|
|
-It is provided for developers writing customization layers for the
|
|
|
|
-stylesheets, and for anyone who's interested in <quote>how it
|
|
|
|
-works</quote>.</para>
|
|
|
|
|
|
+<para>This documentation is not intended to be <quote>user</quote>
|
|
|
|
+documentation. It is provided for developers writing
|
|
|
|
+customization layers for the stylesheets, and for anyone who's
|
|
|
|
+interested in <quote>how it works</quote>.</para>
|
|
|
|
|
|
-<para>Although I am trying to be thorough, this documentation is known
|
|
|
|
-to be incomplete. Don't forget to read the source, too :-)</para>
|
|
|
|
</partintro>
|
|
</partintro>
|
|
|
|
|
|
</doc:reference>
|
|
</doc:reference>
|
|
@@ -99,12 +98,12 @@ manvolnum
|
|
<doc:template name="is.component" xmlns="">
|
|
<doc:template name="is.component" xmlns="">
|
|
<refpurpose>Tests if a given node is a component-level element</refpurpose>
|
|
<refpurpose>Tests if a given node is a component-level element</refpurpose>
|
|
|
|
|
|
-<refdescription>
|
|
|
|
|
|
+<refdescription id="is.component-desc">
|
|
<para>This template returns '1' if the specified node is a component
|
|
<para>This template returns '1' if the specified node is a component
|
|
(Chapter, Appendix, etc.), and '0' otherwise.</para>
|
|
(Chapter, Appendix, etc.), and '0' otherwise.</para>
|
|
</refdescription>
|
|
</refdescription>
|
|
|
|
|
|
-<refparameter>
|
|
|
|
|
|
+<refparameter id="is.component-params">
|
|
<variablelist>
|
|
<variablelist>
|
|
<varlistentry><term>node</term>
|
|
<varlistentry><term>node</term>
|
|
<listitem>
|
|
<listitem>
|
|
@@ -114,7 +113,7 @@ manvolnum
|
|
</variablelist>
|
|
</variablelist>
|
|
</refparameter>
|
|
</refparameter>
|
|
|
|
|
|
-<refreturn>
|
|
|
|
|
|
+<refreturn id="is.component-returns">
|
|
<para>This template returns '1' if the specified node is a component
|
|
<para>This template returns '1' if the specified node is a component
|
|
(Chapter, Appendix, etc.), and '0' otherwise.</para>
|
|
(Chapter, Appendix, etc.), and '0' otherwise.</para>
|
|
</refreturn>
|
|
</refreturn>
|
|
@@ -139,12 +138,12 @@ manvolnum
|
|
<doc:template name="is.section" xmlns="">
|
|
<doc:template name="is.section" xmlns="">
|
|
<refpurpose>Tests if a given node is a section-level element</refpurpose>
|
|
<refpurpose>Tests if a given node is a section-level element</refpurpose>
|
|
|
|
|
|
-<refdescription>
|
|
|
|
|
|
+<refdescription id="is.section-desc">
|
|
<para>This template returns '1' if the specified node is a section
|
|
<para>This template returns '1' if the specified node is a section
|
|
(Section, Sect1, Sect2, etc.), and '0' otherwise.</para>
|
|
(Section, Sect1, Sect2, etc.), and '0' otherwise.</para>
|
|
</refdescription>
|
|
</refdescription>
|
|
|
|
|
|
-<refparameter>
|
|
|
|
|
|
+<refparameter id="is.section-params">
|
|
<variablelist>
|
|
<variablelist>
|
|
<varlistentry><term>node</term>
|
|
<varlistentry><term>node</term>
|
|
<listitem>
|
|
<listitem>
|
|
@@ -154,7 +153,7 @@ manvolnum
|
|
</variablelist>
|
|
</variablelist>
|
|
</refparameter>
|
|
</refparameter>
|
|
|
|
|
|
-<refreturn>
|
|
|
|
|
|
+<refreturn id="is.section-returns">
|
|
<para>This template returns '1' if the specified node is a section
|
|
<para>This template returns '1' if the specified node is a section
|
|
(Section, Sect1, Sect2, etc.), and '0' otherwise.</para>
|
|
(Section, Sect1, Sect2, etc.), and '0' otherwise.</para>
|
|
</refreturn>
|
|
</refreturn>
|
|
@@ -182,7 +181,7 @@ manvolnum
|
|
<doc:template name="section.level" xmlns="">
|
|
<doc:template name="section.level" xmlns="">
|
|
<refpurpose>Returns the hierarchical level of a section</refpurpose>
|
|
<refpurpose>Returns the hierarchical level of a section</refpurpose>
|
|
|
|
|
|
-<refdescription>
|
|
|
|
|
|
+<refdescription id="section.level-desc">
|
|
<para>This template calculates the hierarchical level of a section.
|
|
<para>This template calculates the hierarchical level of a section.
|
|
The element <sgmltag>sect1</sgmltag> is at level 1, <sgmltag>sect2</sgmltag> is
|
|
The element <sgmltag>sect1</sgmltag> is at level 1, <sgmltag>sect2</sgmltag> is
|
|
at level 2, etc.</para>
|
|
at level 2, etc.</para>
|
|
@@ -190,7 +189,7 @@ at level 2, etc.</para>
|
|
<para>Recursive sections are calculated down to the fifth level.</para>
|
|
<para>Recursive sections are calculated down to the fifth level.</para>
|
|
</refdescription>
|
|
</refdescription>
|
|
|
|
|
|
-<refparameter>
|
|
|
|
|
|
+<refparameter id="section.level-params">
|
|
<variablelist>
|
|
<variablelist>
|
|
<varlistentry><term>node</term>
|
|
<varlistentry><term>node</term>
|
|
<listitem>
|
|
<listitem>
|
|
@@ -201,7 +200,7 @@ Defaults to the context node.</para>
|
|
</variablelist>
|
|
</variablelist>
|
|
</refparameter>
|
|
</refparameter>
|
|
|
|
|
|
-<refreturn>
|
|
|
|
|
|
+<refreturn id="section.level-returns">
|
|
<para>The section level, <quote>1</quote>, <quote>2</quote>, etc.
|
|
<para>The section level, <quote>1</quote>, <quote>2</quote>, etc.
|
|
</para>
|
|
</para>
|
|
</refreturn>
|
|
</refreturn>
|
|
@@ -259,12 +258,12 @@ Defaults to the context node.</para>
|
|
<doc:template name="qanda.section.level" xmlns="">
|
|
<doc:template name="qanda.section.level" xmlns="">
|
|
<refpurpose>Returns the hierarchical level of a QandASet</refpurpose>
|
|
<refpurpose>Returns the hierarchical level of a QandASet</refpurpose>
|
|
|
|
|
|
-<refdescription>
|
|
|
|
|
|
+<refdescription id="qanda.section.level-desc">
|
|
<para>This template calculates the hierarchical level of a QandASet.
|
|
<para>This template calculates the hierarchical level of a QandASet.
|
|
</para>
|
|
</para>
|
|
</refdescription>
|
|
</refdescription>
|
|
|
|
|
|
-<refreturn>
|
|
|
|
|
|
+<refreturn id="qanda.section.level-returns">
|
|
<para>The level, <quote>1</quote>, <quote>2</quote>, etc.
|
|
<para>The level, <quote>1</quote>, <quote>2</quote>, etc.
|
|
</para>
|
|
</para>
|
|
</refreturn>
|
|
</refreturn>
|
|
@@ -506,6 +505,9 @@ Defaults to the context node.</para>
|
|
</xsl:when>
|
|
</xsl:when>
|
|
|
|
|
|
<!-- handle corpauthor as a special case...-->
|
|
<!-- handle corpauthor as a special case...-->
|
|
|
|
+ <!-- * MikeSmith 2007-06: I'm wondering if the person.name template -->
|
|
|
|
+ <!-- * actually ever gets called to handle corpauthor.. maybe -->
|
|
|
|
+ <!-- * we don't actually need to check for corpauthor here. -->
|
|
<xsl:when test="local-name($node)='corpauthor'">
|
|
<xsl:when test="local-name($node)='corpauthor'">
|
|
<xsl:apply-templates select="$node"/>
|
|
<xsl:apply-templates select="$node"/>
|
|
</xsl:when>
|
|
</xsl:when>
|
|
@@ -828,7 +830,7 @@ Defaults to the context node.</para>
|
|
<doc:template name="select.mediaobject" xmlns="">
|
|
<doc:template name="select.mediaobject" xmlns="">
|
|
<refpurpose>Selects and processes an appropriate media object from a list</refpurpose>
|
|
<refpurpose>Selects and processes an appropriate media object from a list</refpurpose>
|
|
|
|
|
|
-<refdescription>
|
|
|
|
|
|
+<refdescription id="select.mediaobject-desc">
|
|
<para>This template takes a list of media objects (usually the
|
|
<para>This template takes a list of media objects (usually the
|
|
children of a mediaobject or inlinemediaobject) and processes
|
|
children of a mediaobject or inlinemediaobject) and processes
|
|
the "right" object.</para>
|
|
the "right" object.</para>
|
|
@@ -840,7 +842,7 @@ in the list is appropriate.</para>
|
|
<para>If no acceptable object is located, nothing happens.</para>
|
|
<para>If no acceptable object is located, nothing happens.</para>
|
|
</refdescription>
|
|
</refdescription>
|
|
|
|
|
|
-<refparameter>
|
|
|
|
|
|
+<refparameter id="select.mediaobject-params">
|
|
<variablelist>
|
|
<variablelist>
|
|
<varlistentry><term>olist</term>
|
|
<varlistentry><term>olist</term>
|
|
<listitem>
|
|
<listitem>
|
|
@@ -850,7 +852,7 @@ in the list is appropriate.</para>
|
|
</variablelist>
|
|
</variablelist>
|
|
</refparameter>
|
|
</refparameter>
|
|
|
|
|
|
-<refreturn>
|
|
|
|
|
|
+<refreturn id="select.mediaobject-returns">
|
|
<para>Calls <xsl:apply-templates> on the selected object.</para>
|
|
<para>Calls <xsl:apply-templates> on the selected object.</para>
|
|
</refreturn>
|
|
</refreturn>
|
|
</doc:template>
|
|
</doc:template>
|
|
@@ -877,7 +879,7 @@ in the list is appropriate.</para>
|
|
<doc:template name="select.mediaobject.index" xmlns="">
|
|
<doc:template name="select.mediaobject.index" xmlns="">
|
|
<refpurpose>Selects the position of the appropriate media object from a list</refpurpose>
|
|
<refpurpose>Selects the position of the appropriate media object from a list</refpurpose>
|
|
|
|
|
|
-<refdescription>
|
|
|
|
|
|
+<refdescription id="select.mediaobject.index-desc">
|
|
<para>This template takes a list of media objects (usually the
|
|
<para>This template takes a list of media objects (usually the
|
|
children of a mediaobject or inlinemediaobject) and determines
|
|
children of a mediaobject or inlinemediaobject) and determines
|
|
the "right" object. It returns the position of that object
|
|
the "right" object. It returns the position of that object
|
|
@@ -897,7 +899,7 @@ of media objects is that the first acceptable graphic should be used.
|
|
<para>If no acceptable object is located, no index is returned.</para>
|
|
<para>If no acceptable object is located, no index is returned.</para>
|
|
</refdescription>
|
|
</refdescription>
|
|
|
|
|
|
-<refparameter>
|
|
|
|
|
|
+<refparameter id="select.mediaobject.index-params">
|
|
<variablelist>
|
|
<variablelist>
|
|
<varlistentry><term>olist</term>
|
|
<varlistentry><term>olist</term>
|
|
<listitem>
|
|
<listitem>
|
|
@@ -913,7 +915,7 @@ recursive process.</para>
|
|
</variablelist>
|
|
</variablelist>
|
|
</refparameter>
|
|
</refparameter>
|
|
|
|
|
|
-<refreturn>
|
|
|
|
|
|
+<refreturn id="select.mediaobject.index-returns">
|
|
<para>Returns the position in the original list of the selected object.</para>
|
|
<para>Returns the position in the original list of the selected object.</para>
|
|
</refreturn>
|
|
</refreturn>
|
|
</doc:template>
|
|
</doc:template>
|
|
@@ -1045,12 +1047,12 @@ recursive process.</para>
|
|
<doc:template name="is.acceptable.mediaobject" xmlns="">
|
|
<doc:template name="is.acceptable.mediaobject" xmlns="">
|
|
<refpurpose>Returns '1' if the specified media object is recognized</refpurpose>
|
|
<refpurpose>Returns '1' if the specified media object is recognized</refpurpose>
|
|
|
|
|
|
-<refdescription>
|
|
|
|
|
|
+<refdescription id="is.acceptable.mediaobject-desc">
|
|
<para>This template examines a media object and returns '1' if the
|
|
<para>This template examines a media object and returns '1' if the
|
|
object is recognized as a graphic.</para>
|
|
object is recognized as a graphic.</para>
|
|
</refdescription>
|
|
</refdescription>
|
|
|
|
|
|
-<refparameter>
|
|
|
|
|
|
+<refparameter id="is.acceptable.mediaobject-params">
|
|
<variablelist>
|
|
<variablelist>
|
|
<varlistentry><term>object</term>
|
|
<varlistentry><term>object</term>
|
|
<listitem>
|
|
<listitem>
|
|
@@ -1060,7 +1062,7 @@ object is recognized as a graphic.</para>
|
|
</variablelist>
|
|
</variablelist>
|
|
</refparameter>
|
|
</refparameter>
|
|
|
|
|
|
-<refreturn>
|
|
|
|
|
|
+<refreturn id="is.acceptable.mediaobject-returns">
|
|
<para>0 or 1</para>
|
|
<para>0 or 1</para>
|
|
</refreturn>
|
|
</refreturn>
|
|
</doc:template>
|
|
</doc:template>
|
|
@@ -1191,7 +1193,7 @@ object is recognized as a graphic.</para>
|
|
|
|
|
|
<doc:template name="check.id.unique" xmlns="">
|
|
<doc:template name="check.id.unique" xmlns="">
|
|
<refpurpose>Warn users about references to non-unique IDs</refpurpose>
|
|
<refpurpose>Warn users about references to non-unique IDs</refpurpose>
|
|
-<refdescription>
|
|
|
|
|
|
+<refdescription id="check.id.unique-desc">
|
|
<para>If passed an ID in <varname>linkend</varname>,
|
|
<para>If passed an ID in <varname>linkend</varname>,
|
|
<function>check.id.unique</function> prints
|
|
<function>check.id.unique</function> prints
|
|
a warning message to the user if either the ID does not exist or
|
|
a warning message to the user if either the ID does not exist or
|
|
@@ -1231,7 +1233,7 @@ the ID is not unique.</para>
|
|
|
|
|
|
<doc:template name="check.idref.targets" xmlns="">
|
|
<doc:template name="check.idref.targets" xmlns="">
|
|
<refpurpose>Warn users about incorrectly typed references</refpurpose>
|
|
<refpurpose>Warn users about incorrectly typed references</refpurpose>
|
|
-<refdescription>
|
|
|
|
|
|
+<refdescription id="check.idref.targets-desc">
|
|
<para>If passed an ID in <varname>linkend</varname>,
|
|
<para>If passed an ID in <varname>linkend</varname>,
|
|
<function>check.idref.targets</function> makes sure that the element
|
|
<function>check.idref.targets</function> makes sure that the element
|
|
pointed to by the link is one of the elements listed in
|
|
pointed to by the link is one of the elements listed in
|
|
@@ -1487,7 +1489,7 @@ pointed to by the link is one of the elements listed in
|
|
<doc:template name="copyright.years" xmlns="">
|
|
<doc:template name="copyright.years" xmlns="">
|
|
<refpurpose>Print a set of years with collapsed ranges</refpurpose>
|
|
<refpurpose>Print a set of years with collapsed ranges</refpurpose>
|
|
|
|
|
|
-<refdescription>
|
|
|
|
|
|
+<refdescription id="copyright.years-desc">
|
|
<para>This template prints a list of year elements with consecutive
|
|
<para>This template prints a list of year elements with consecutive
|
|
years printed as a range. In other words:</para>
|
|
years printed as a range. In other words:</para>
|
|
|
|
|
|
@@ -1509,7 +1511,7 @@ are expressed in full <quote>century+year</quote>
|
|
(<quote>1999</quote> not <quote>99</quote>) notation.</para>
|
|
(<quote>1999</quote> not <quote>99</quote>) notation.</para>
|
|
</refdescription>
|
|
</refdescription>
|
|
|
|
|
|
-<refparameter>
|
|
|
|
|
|
+<refparameter id="copyright.years-params">
|
|
<variablelist>
|
|
<variablelist>
|
|
<varlistentry><term>years</term>
|
|
<varlistentry><term>years</term>
|
|
<listitem>
|
|
<listitem>
|
|
@@ -1533,7 +1535,7 @@ year range is <quote>1991-1992</quote> but discretely it's
|
|
</variablelist>
|
|
</variablelist>
|
|
</refparameter>
|
|
</refparameter>
|
|
|
|
|
|
-<refreturn>
|
|
|
|
|
|
+<refreturn id="copyright.years-returns">
|
|
<para>This template returns the formatted list of years.</para>
|
|
<para>This template returns the formatted list of years.</para>
|
|
</refreturn>
|
|
</refreturn>
|
|
</doc:template>
|
|
</doc:template>
|
|
@@ -1665,7 +1667,7 @@ year range is <quote>1991-1992</quote> but discretely it's
|
|
<doc:template name="find.path.params" xmlns="">
|
|
<doc:template name="find.path.params" xmlns="">
|
|
<refpurpose>Search in a table for the "best" match for the node</refpurpose>
|
|
<refpurpose>Search in a table for the "best" match for the node</refpurpose>
|
|
|
|
|
|
-<refdescription>
|
|
|
|
|
|
+<refdescription id="find.path.params-desc">
|
|
<para>This template searches in a table for the value that most-closely
|
|
<para>This template searches in a table for the value that most-closely
|
|
(in the typical best-match sense of XSLT) matches the current (element)
|
|
(in the typical best-match sense of XSLT) matches the current (element)
|
|
node location.</para>
|
|
node location.</para>
|
|
@@ -1815,7 +1817,7 @@ node location.</para>
|
|
<doc:template name="string.upper" xmlns="">
|
|
<doc:template name="string.upper" xmlns="">
|
|
<refpurpose>Converts a string to all uppercase letters</refpurpose>
|
|
<refpurpose>Converts a string to all uppercase letters</refpurpose>
|
|
|
|
|
|
-<refdescription>
|
|
|
|
|
|
+<refdescription id="string.upper-desc">
|
|
<para>Given a string, this template does a language-aware conversion
|
|
<para>Given a string, this template does a language-aware conversion
|
|
of that string to all uppercase letters, based on the values of the
|
|
of that string to all uppercase letters, based on the values of the
|
|
<literal>lowercase.alpha</literal> and
|
|
<literal>lowercase.alpha</literal> and
|
|
@@ -1826,7 +1828,7 @@ locale. It affects only those characters found in the values of
|
|
unchanged.</para>
|
|
unchanged.</para>
|
|
</refdescription>
|
|
</refdescription>
|
|
|
|
|
|
-<refparameter>
|
|
|
|
|
|
+<refparameter id="string.upper-params">
|
|
<variablelist>
|
|
<variablelist>
|
|
<varlistentry><term>string</term>
|
|
<varlistentry><term>string</term>
|
|
<listitem>
|
|
<listitem>
|
|
@@ -1856,7 +1858,7 @@ unchanged.</para>
|
|
<doc:template name="string.lower" xmlns="">
|
|
<doc:template name="string.lower" xmlns="">
|
|
<refpurpose>Converts a string to all lowercase letters</refpurpose>
|
|
<refpurpose>Converts a string to all lowercase letters</refpurpose>
|
|
|
|
|
|
-<refdescription>
|
|
|
|
|
|
+<refdescription id="string.lower-desc">
|
|
<para>Given a string, this template does a language-aware conversion
|
|
<para>Given a string, this template does a language-aware conversion
|
|
of that string to all lowercase letters, based on the values of the
|
|
of that string to all lowercase letters, based on the values of the
|
|
<literal>uppercase.alpha</literal> and
|
|
<literal>uppercase.alpha</literal> and
|
|
@@ -1867,7 +1869,7 @@ locale. It affects only those characters found in the values of
|
|
unchanged.</para>
|
|
unchanged.</para>
|
|
</refdescription>
|
|
</refdescription>
|
|
|
|
|
|
-<refparameter>
|
|
|
|
|
|
+<refparameter id="string.lower-params">
|
|
<variablelist>
|
|
<variablelist>
|
|
<varlistentry><term>string</term>
|
|
<varlistentry><term>string</term>
|
|
<listitem>
|
|
<listitem>
|
|
@@ -1896,7 +1898,7 @@ unchanged.</para>
|
|
|
|
|
|
<doc:template name="select.choice.separator" xmlns="">
|
|
<doc:template name="select.choice.separator" xmlns="">
|
|
<refpurpose>Returns localized choice separator</refpurpose>
|
|
<refpurpose>Returns localized choice separator</refpurpose>
|
|
- <refdescription>
|
|
|
|
|
|
+ <refdescription id="select.choice.separator-desc">
|
|
<para>This template enables auto-generation of an appropriate
|
|
<para>This template enables auto-generation of an appropriate
|
|
localized "choice" separator (for example, "and" or "or") before
|
|
localized "choice" separator (for example, "and" or "or") before
|
|
the final item in an inline list (though it could also be useful
|
|
the final item in an inline list (though it could also be useful
|
|
@@ -1962,7 +1964,7 @@ unchanged.</para>
|
|
|
|
|
|
<doc:template name="evaluate.info.profile" xmlns="">
|
|
<doc:template name="evaluate.info.profile" xmlns="">
|
|
<refpurpose>Evaluates an info profile</refpurpose>
|
|
<refpurpose>Evaluates an info profile</refpurpose>
|
|
- <refdescription>
|
|
|
|
|
|
+ <refdescription id="evaluate.info.profile-desc">
|
|
<para>This template evaluates an "info profile" matching the XPath
|
|
<para>This template evaluates an "info profile" matching the XPath
|
|
expression given by the <parameter>profile</parameter>
|
|
expression given by the <parameter>profile</parameter>
|
|
parameter. It relies on the XSLT <function>evaluate()</function>
|
|
parameter. It relies on the XSLT <function>evaluate()</function>
|
|
@@ -1977,7 +1979,7 @@ unchanged.</para>
|
|
expression is then evaluated using the XSLT
|
|
expression is then evaluated using the XSLT
|
|
<function>evaluate()</function> extension function.</para>
|
|
<function>evaluate()</function> extension function.</para>
|
|
</refdescription>
|
|
</refdescription>
|
|
- <refparameter>
|
|
|
|
|
|
+ <refparameter id="evaluate.info.profile-params">
|
|
<variablelist>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<varlistentry>
|
|
<term>profile</term>
|
|
<term>profile</term>
|
|
@@ -1994,7 +1996,7 @@ unchanged.</para>
|
|
</variablelist>
|
|
</variablelist>
|
|
</refparameter>
|
|
</refparameter>
|
|
|
|
|
|
- <refreturn>
|
|
|
|
|
|
+ <refreturn id="evaluate.info.profile-returns">
|
|
<para>Returns a node (the result of evaluating the
|
|
<para>Returns a node (the result of evaluating the
|
|
<parameter>profile</parameter> parameter)</para>
|
|
<parameter>profile</parameter> parameter)</para>
|
|
</refreturn>
|
|
</refreturn>
|
|
@@ -2023,254 +2025,4 @@ engine does not support it.
|
|
</xsl:choose>
|
|
</xsl:choose>
|
|
</xsl:template>
|
|
</xsl:template>
|
|
|
|
|
|
-<!-- ===================================== -->
|
|
|
|
-
|
|
|
|
-<doc:template name="log.message" xmlns="">
|
|
|
|
- <refpurpose>Logs/emits formatted notes and warnings</refpurpose>
|
|
|
|
-
|
|
|
|
- <refdescription>
|
|
|
|
- <para>The <function>log.message</function> template is a utility
|
|
|
|
- template for logging/emitting formatted messages – that is,
|
|
|
|
- notes and warnings, along with a given log "level" and an
|
|
|
|
- identifier for the "source" that the message relates to.</para>
|
|
|
|
- </refdescription>
|
|
|
|
-
|
|
|
|
- <refparameter>
|
|
|
|
- <variablelist>
|
|
|
|
- <varlistentry>
|
|
|
|
- <term>level</term>
|
|
|
|
- <listitem>
|
|
|
|
- <para>Text to log/emit in the message-level field to
|
|
|
|
- indicate the message level
|
|
|
|
- (<literal>Note</literal> or
|
|
|
|
- <literal>Warning</literal>)</para>
|
|
|
|
- </listitem>
|
|
|
|
- </varlistentry>
|
|
|
|
- <varlistentry>
|
|
|
|
- <term>source</term>
|
|
|
|
- <listitem>
|
|
|
|
- <para>Text to log/emit in the source field to identify the
|
|
|
|
- “source” to which the notification/warning relates.
|
|
|
|
- This can be any arbitrary string, but because the
|
|
|
|
- message lacks line and column numbers to identify the
|
|
|
|
- exact part of the source document to which it
|
|
|
|
- relates, the intention is that the value you pass
|
|
|
|
- into the <literal>source</literal> parameter should
|
|
|
|
- give the user some way to identify the portion of
|
|
|
|
- their source document on which to take potentially
|
|
|
|
- take action in response to the log message (for
|
|
|
|
- example, to edit, change, or add content).</para>
|
|
|
|
- <para>So the <literal>source</literal> value should be,
|
|
|
|
- for example, an ID, book/chapter/article title, title
|
|
|
|
- of some formal object, or even a string giving an
|
|
|
|
- XPath expression.</para>
|
|
|
|
- </listitem>
|
|
|
|
- </varlistentry>
|
|
|
|
- <varlistentry>
|
|
|
|
- <term>context-desc</term>
|
|
|
|
- <listitem>
|
|
|
|
- <para>Text to log/emit in the context-description field to
|
|
|
|
- describe the context for the message.</para>
|
|
|
|
- </listitem>
|
|
|
|
- </varlistentry>
|
|
|
|
- <varlistentry>
|
|
|
|
- <term>context-desc-field-length</term>
|
|
|
|
- <listitem>
|
|
|
|
- <para>Specifies length of the context-description field
|
|
|
|
- (in characters); default is 12</para>
|
|
|
|
- <para>If the text specified by the
|
|
|
|
- <literal>context-desc</literal> parameter is longer
|
|
|
|
- than the number of characters specified in
|
|
|
|
- <literal>context-desc-field-length</literal>, it is
|
|
|
|
- truncated to <literal>context-desc-field-length</literal>
|
|
|
|
- (12 characters by default).</para>
|
|
|
|
- <para>If the specified text is shorter than
|
|
|
|
- <literal>context-desc-field-length</literal>,
|
|
|
|
- it is right-padded out to
|
|
|
|
- <literal>context-desc-field-length</literal> (12 by
|
|
|
|
- default).</para>
|
|
|
|
- <para>If no value has been specified for the
|
|
|
|
- <literal>context-desc</literal> parameter, the field is
|
|
|
|
- left empty and the text of the log message begins with
|
|
|
|
- the value of the <literal>message</literal>
|
|
|
|
- parameter.</para>
|
|
|
|
- </listitem>
|
|
|
|
- </varlistentry>
|
|
|
|
- <varlistentry>
|
|
|
|
- <term>message</term>
|
|
|
|
- <listitem>
|
|
|
|
- <para>Text to log/emit in the actual message field</para>
|
|
|
|
- </listitem>
|
|
|
|
- </varlistentry>
|
|
|
|
- <varlistentry>
|
|
|
|
- <term>message-field-length</term>
|
|
|
|
- <listitem>
|
|
|
|
- <para>Specifies length of the message
|
|
|
|
- field (in characters); default is 45</para>
|
|
|
|
- </listitem>
|
|
|
|
- </varlistentry>
|
|
|
|
- </variablelist>
|
|
|
|
- </refparameter>
|
|
|
|
- <refreturn>
|
|
|
|
- <para>Outputs a message (generally, to standard error).</para></refreturn>
|
|
|
|
-</doc:template>
|
|
|
|
-<xsl:template name="log.message">
|
|
|
|
- <xsl:param name="level"/>
|
|
|
|
- <xsl:param name="source"/>
|
|
|
|
- <xsl:param name="context-desc"/>
|
|
|
|
- <xsl:param name="context-desc-field-length">12</xsl:param>
|
|
|
|
- <xsl:param name="context-desc-padded">
|
|
|
|
- <xsl:if test="not($context-desc = '')">
|
|
|
|
- <xsl:call-template name="pad-string">
|
|
|
|
- <xsl:with-param name="leftRight">right</xsl:with-param>
|
|
|
|
- <xsl:with-param name="padVar"
|
|
|
|
- select="substring($context-desc, 1, $context-desc-field-length)"/>
|
|
|
|
- <xsl:with-param name="length" select="$context-desc-field-length"/>
|
|
|
|
- </xsl:call-template>
|
|
|
|
- </xsl:if>
|
|
|
|
- </xsl:param>
|
|
|
|
- <xsl:param name="message"/>
|
|
|
|
- <xsl:param name="message-field-length" select="45"/>
|
|
|
|
- <xsl:param name="message-padded">
|
|
|
|
- <xsl:variable name="spaces-for-blank-level">
|
|
|
|
- <!-- * if the level field is blank, we'll need to pad out -->
|
|
|
|
- <!-- * the message field with spaces to compensate -->
|
|
|
|
- <xsl:choose>
|
|
|
|
- <xsl:when test="$level = ''">
|
|
|
|
- <xsl:value-of select="4 + 2"/>
|
|
|
|
- <!-- * 4 = hard-coded length of comment text ("Note" or "Warn") -->
|
|
|
|
- <!-- * + 2 = length of colon-plus-space separator ": " -->
|
|
|
|
- </xsl:when>
|
|
|
|
- <xsl:otherwise>
|
|
|
|
- <xsl:value-of select="0"/>
|
|
|
|
- </xsl:otherwise>
|
|
|
|
- </xsl:choose>
|
|
|
|
- </xsl:variable>
|
|
|
|
- <xsl:variable name="spaces-for-blank-context-desc">
|
|
|
|
- <!-- * if the context-description field is blank, we'll need -->
|
|
|
|
- <!-- * to pad out the message field with spaces to compensate -->
|
|
|
|
- <xsl:choose>
|
|
|
|
- <xsl:when test="$context-desc = ''">
|
|
|
|
- <xsl:value-of select="$context-desc-field-length + 2"/>
|
|
|
|
- <!-- * + 2 = length of colon-plus-space separator ": " -->
|
|
|
|
- </xsl:when>
|
|
|
|
- <xsl:otherwise>
|
|
|
|
- <xsl:value-of select="0"/>
|
|
|
|
- </xsl:otherwise>
|
|
|
|
- </xsl:choose>
|
|
|
|
- </xsl:variable>
|
|
|
|
- <xsl:variable name="extra-spaces"
|
|
|
|
- select="$spaces-for-blank-level + $spaces-for-blank-context-desc"/>
|
|
|
|
- <xsl:call-template name="pad-string">
|
|
|
|
- <xsl:with-param name="leftRight">right</xsl:with-param>
|
|
|
|
- <xsl:with-param name="padVar"
|
|
|
|
- select="substring($message, 1, ($message-field-length + $extra-spaces))"/>
|
|
|
|
- <xsl:with-param name="length"
|
|
|
|
- select="$message-field-length + $extra-spaces"/>
|
|
|
|
- </xsl:call-template>
|
|
|
|
- </xsl:param>
|
|
|
|
- <!-- * emit the actual log message -->
|
|
|
|
- <xsl:message>
|
|
|
|
- <xsl:if test="not($level = '')">
|
|
|
|
- <xsl:value-of select="$level"/>
|
|
|
|
- <xsl:text>: </xsl:text>
|
|
|
|
- </xsl:if>
|
|
|
|
- <xsl:if test="not($context-desc = '')">
|
|
|
|
- <xsl:value-of select="$context-desc-padded"/>
|
|
|
|
- <xsl:text>: </xsl:text>
|
|
|
|
- </xsl:if>
|
|
|
|
- <xsl:value-of select="$message-padded"/>
|
|
|
|
- <xsl:text> </xsl:text>
|
|
|
|
- <xsl:value-of select="$source"/>
|
|
|
|
- </xsl:message>
|
|
|
|
-</xsl:template>
|
|
|
|
-
|
|
|
|
-<!-- ===================================== -->
|
|
|
|
-<doc:template name="get.doc.title" xmlns="">
|
|
|
|
- <refpurpose>Get a title for the current document</refpurpose>
|
|
|
|
- <refdescription>
|
|
|
|
- <para>The <function>get.doc.title</function> template is a
|
|
|
|
- utility template for returning the first title found in the
|
|
|
|
- current document.</para>
|
|
|
|
- </refdescription>
|
|
|
|
- <refreturn>
|
|
|
|
- <para>Returns a string containing some identifying title for the
|
|
|
|
- current document .</para></refreturn>
|
|
|
|
-</doc:template>
|
|
|
|
-<xsl:template name="get.doc.title">
|
|
|
|
- <xsl:choose>
|
|
|
|
- <xsl:when test="//*[local-name() = 'title'
|
|
|
|
- or local-name() = 'refname']">
|
|
|
|
- <xsl:value-of select="//*[local-name() = 'title'
|
|
|
|
- or local-name() = 'refname'][1]"/>
|
|
|
|
- </xsl:when>
|
|
|
|
- <xsl:when test="substring(local-name(*[1]),
|
|
|
|
- string-length(local-name(*[1])-3) = 'info')
|
|
|
|
- and *[1]/*[local-name() = 'title']">
|
|
|
|
- <xsl:value-of select="*[1]/*[local-name() = 'title'][1]"/>
|
|
|
|
- </xsl:when>
|
|
|
|
- </xsl:choose>
|
|
|
|
-</xsl:template>
|
|
|
|
-
|
|
|
|
-<!-- ===================================== -->
|
|
|
|
-<doc:template name="pad.string" xmlns="">
|
|
|
|
- <refpurpose>Right-pad or left-pad a string out to a certain length</refpurpose>
|
|
|
|
- <refdescription>
|
|
|
|
- <para>This function takes string <parameter>padVar</parameter> and
|
|
|
|
- pads it out in the direction <parameter>rightLeft</parameter> to
|
|
|
|
- the string-length <parameter>length</parameter>, using string
|
|
|
|
- <parameter>padChar</parameter> (a space character by default) as
|
|
|
|
- the padding string (note that <parameter>padChar</parameter> can
|
|
|
|
- be a string; it is not limited to just being a single
|
|
|
|
- character).</para>
|
|
|
|
-
|
|
|
|
- <note>
|
|
|
|
- <para>This function began as a copy of Nate Austin's
|
|
|
|
- <function>prepend-pad</function> function in the <ulink
|
|
|
|
- url="http://www.dpawson.co.uk/xsl/sect2/padding.html" >Padding
|
|
|
|
- Content</ulink> section of Dave Pawson's <ulink
|
|
|
|
- url="http://www.dpawson.co.uk/xsl/index.html" >XSLT
|
|
|
|
- FAQ</ulink>.</para>
|
|
|
|
- </note>
|
|
|
|
- </refdescription>
|
|
|
|
- <refreturn>
|
|
|
|
- <para>Returns a (padded) string.</para></refreturn>
|
|
|
|
-</doc:template>
|
|
|
|
-
|
|
|
|
-<xsl:template name="pad-string">
|
|
|
|
- <!-- * recursive template to right/left pad the value with -->
|
|
|
|
- <!-- * whatever padChar is passed in -->
|
|
|
|
- <xsl:param name="padChar" select="' '"/>
|
|
|
|
- <xsl:param name="leftRight">left</xsl:param>
|
|
|
|
- <xsl:param name="padVar"/>
|
|
|
|
- <xsl:param name="length"/>
|
|
|
|
- <xsl:choose>
|
|
|
|
- <xsl:when test="string-length($padVar) < $length">
|
|
|
|
- <xsl:call-template name="pad-string">
|
|
|
|
- <xsl:with-param name="padChar" select="$padChar"/>
|
|
|
|
- <xsl:with-param name="leftRight" select="$leftRight"/>
|
|
|
|
- <xsl:with-param name="padVar">
|
|
|
|
- <xsl:choose>
|
|
|
|
- <!-- * determine whether string should be -->
|
|
|
|
- <!-- * right- or left-padded -->
|
|
|
|
- <xsl:when test="$leftRight = 'left'">
|
|
|
|
- <!-- * pad it to left -->
|
|
|
|
- <xsl:value-of select="concat($padChar,$padVar)"/>
|
|
|
|
- </xsl:when>
|
|
|
|
- <xsl:otherwise>
|
|
|
|
- <!-- * otherwise, right-pad the string -->
|
|
|
|
- <xsl:value-of select="concat($padVar,$padChar)"/>
|
|
|
|
- </xsl:otherwise>
|
|
|
|
- </xsl:choose>
|
|
|
|
- </xsl:with-param>
|
|
|
|
- <xsl:with-param name="length" select="$length"/>
|
|
|
|
- </xsl:call-template>
|
|
|
|
- </xsl:when>
|
|
|
|
- <xsl:otherwise>
|
|
|
|
- <xsl:value-of
|
|
|
|
- select="substring($padVar,string-length($padVar) - $length + 1)"/>
|
|
|
|
- </xsl:otherwise>
|
|
|
|
- </xsl:choose>
|
|
|
|
-</xsl:template>
|
|
|
|
-
|
|
|
|
</xsl:stylesheet>
|
|
</xsl:stylesheet>
|