$Id: common.xsl,v 1.15 2002/01/03 14:24:14 nwalsh Exp $
Copyright © 1999, 2000 by Norman Walsh. No Warranty.
This is technical reference documentation for the DocBook XSL Stylesheets; it documents (some of) the parameters, templates, and other elements of the stylesheets.
This is not intended to be “user” documentation. It is provided for developers writing customization layers for the stylesheets, and for anyone who's interested in “how it works”.
Although I am trying to be thorough, this documentation is known to be incomplete. Don't forget to read the source, too :-)
Table of Contents
is.component — Tests if a given node is a component-level element
<xsl:template name="is.component"> <xsl:param name="node" select="."/> ... </xsl:template>
is.section — Tests if a given node is a section-level element
<xsl:template name="is.section"> <xsl:param name="node" select="."/> ... </xsl:template>
section.level — Returns the hierarchical level of a section.
<xsl:template name="section.level"> <xsl:param name="node" select="."/> ... </xsl:template>
This template calculates the hierarchical level of a section. Hierarchically, components are “top level”, so a sect1 is at level 2, sect3 is at level 3, etc.
Recursive sections are calculated down to the sixth level.
qanda.section.level — Returns the hierarchical level of a QandASet.
<xsl:template name="qanda.section.level"/>
select.mediaobject — Selects an appropriate media object from a list
<xsl:template name="select.mediaobject"> <xsl:param name="olist" select="imageobject|imageobjectco |videoobject|audioobject|textobject"/> <xsl:param name="count">1</xsl:param> ... </xsl:template>
This template examines a list of media objects (usually the children of a mediaobject or inlinemediaobject) and processes the "right" object.
This template relies on a template named "is.acceptable.mediaobject" to determine if a given object is an acceptable graphic. The semantics of media objects is that the first acceptable graphic should be used.
If no acceptable object is located, nothing happens.
is.acceptable.mediaobject — Returns '1' if the specified media object is recognized.
<xsl:template name="is.acceptable.mediaobject"> <xsl:param name="object"/> ... </xsl:template>
check.id.unique — Warn users about references to non-unique IDs
<xsl:template name="check.id.unique"> <xsl:param name="linkend"/> ... </xsl:template>
check.idref.targets — Warn users about incorrectly typed references
<xsl:template name="check.idref.targets"> <xsl:param name="linkend"/> <xsl:param name="element-list"/> ... </xsl:template>
copyright.years — Print a set of years with collapsed ranges
<xsl:template name="copyright.years"> <xsl:param name="years"/> <xsl:param name="print.ranges" select="1"/> <xsl:param name="single.year.ranges" select="0"/> <xsl:param name="firstyear" select="0"/> <xsl:param name="nextyear" select="0"/> ... </xsl:template>
This template prints a list of year elements with consecutive years printed as a range. In other words:
<year>1992</year> <year>1993</year> <year>1994</year>
is printed “1992-1994”, whereas:
<year>1992</year> <year>1994</year>
is printed “1992, 1994”.
This template assumes that all the year elements contain only decimal year numbers, that the elements are sorted in increasing numerical order, that there are no duplicates, and that all the years are expressed in full “century+year” (“1999” not “99”) notation.
The initial set of year elements.
If non-zero, multi-year ranges are collapsed. If zero, all years are printed discretely.
If non-zero, two consecutive years will be printed as a range, otherwise, they will be printed discretely. In other words, a single year range is “1991-1992” but discretely it's “1991, 1992”.