the db* start PI handling.
<!-- ====================================================================== -->
<!-- OrderedList Numeration -->
-
-<xsl:template name="orderedlist-starting-number">
- <xsl:param name="list" select="."/>
- <!-- Need a neutral dbxxx -->
- <xsl:variable name="pi-html-start">
- <xsl:call-template name="pi.dbhtml_start">
- <xsl:with-param name="node" select="$list"/>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="pi-fo-start">
- <xsl:call-template name="pi.dbfo_start">
- <xsl:with-param name="node" select="$list"/>
- </xsl:call-template>
- </xsl:variable>
+<xsl:template name="output-orderedlist-starting-number">
+ <xsl:param name="list"/>
+ <xsl:param name="pi-start"/>
<xsl:choose>
<xsl:when test="not($list/@continuation = 'continues')">
<xsl:choose>
<xsl:when test="@startingnumber">
<xsl:value-of select="@startingnumber"/>
</xsl:when>
- <xsl:when test="$pi-html-start != ''">
- <xsl:value-of select="$pi-html-start"/>
- </xsl:when>
- <xsl:when test="$pi-fo-start != ''">
- <xsl:value-of select="$pi-fo-start"/>
+ <xsl:when test="$pi-start != ''">
+ <xsl:value-of select="$pi-start"/>
</xsl:when>
<xsl:otherwise>1</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="prevlist"
- select="$list/preceding::orderedlist[1]"/>
+ select="$list/preceding::orderedlist[1]"/>
<xsl:choose>
<xsl:when test="count($prevlist) = 0">2</xsl:when>
<xsl:otherwise>
<xsl:template name="orderedlist-item-number">
<!-- context node must be a listitem in an orderedlist -->
<xsl:param name="node" select="."/>
-
<xsl:choose>
<xsl:when test="$node/@override">
<xsl:value-of select="$node/@override"/>
localized "choice" separator (for example, "and" or "or") before
the final item in an inline list (though it could also be useful
for generating choice separators for non-inline lists).</para>
-
<para>It currently works by evaluating a processing instruction
(PI) of the form <?dbchoice choice="foo"?> :
-
<itemizedlist>
<listitem>
<simpara>if the value of the <sgmltag>choice</sgmltag>
<sgmltag>choice</sgmltag> pseudo-attribute</simpara>
</listitem>
</itemizedlist>
-
The latter is provided only as a temporary workaround because the
locale files do not currently have translations for the word
<wordasword>or</wordasword>. So if you want to generate a a
logical "or" separator in French (for example), you currently need
to do this:
-
<literallayout><?dbchoice choice="ou"?></literallayout>
</para>
-
<warning>
<para>The <sgmltag>dbchoice</sgmltag> processing instruction is
an unfortunate hack; support for it may disappear in the future
</refdescription>
</doc:template>
<xsl:template name="select.choice.separator">
-
<xsl:variable name="choice">
- <xsl:call-template name="pi-attribute">
- <xsl:with-param name="pis" select="processing-instruction('dbchoice')"/>
- <xsl:with-param name="attribute">choice</xsl:with-param>
- </xsl:call-template>
+ <xsl:call-template name="pi.dbchoice_choice"/>
</xsl:variable>
-
<xsl:choose>
<!-- if value of $choice is "and" or "or", translate to equivalent in -->
<!-- current locale -->
</xsl:otherwise>
</xsl:choose>
</xsl:template>
-
</xsl:stylesheet>
See ../README or http://docbook.sf.net/release/xsl/current/ for
copyright and other information.
- This file contains general templates for processing processing
- instructions common to multiple output formats.
******************************************************************** -->
+<doc:reference xmlns="">
+ <referenceinfo>
+ <releaseinfo role="meta">
+ $Id$
+ </releaseinfo>
+ <authorgroup>
+ <author>
+ <orgname>The DocBook Project Development Team</orgname>
+ </author>
+ </authorgroup>
+ <copyright>
+ <year>2007</year>
+ <holder>The DocBook Project</holder>
+ </copyright>
+ </referenceinfo>
+ <title>Common Processing Instruction Reference</title>
+ <partintro id="partintro">
+ <title>Introduction</title>
+ <para>This is generated reference documentation for all
+ user-specifiable processing instructions (PIs) in the
+ “common” part of the DocBook XSL stylesheets.
+ <note>
+ <para>You add these PIs at particular points in a document to
+ cause specific “exceptions” to formatting/output behavior. To
+ make global changes in formatting/output behavior across an
+ entire document, it’s better to do it by setting an
+ appropriate stylesheet parameter (if there is one).</para>
+ </note>
+ </para>
+ </partintro>
+</doc:reference>
+
+<!-- ==================================================================== -->
+<doc:template name="dbchoice_choice" xmlns="">
+ <refpurpose>Generates a localized choice separator</refpurpose>
+ <refdescription id="select.choice.separator-desc">
+ <para>Use the <tag class="xmlpi">dbchoice choice</tag> PI to
+ generate an appropriate localized “choice” separator (for
+ example, <literal>and</literal> or <literal>or</literal>)
+ before the final item in an inline <tag>simplelist</tag></para>
+ <warning>
+ <para>This PI is a less-than-ideal hack; support for it may
+ disappear in the future (particularly if and when a more
+ appropriate means for marking up "choice" lists becomes
+ available in DocBook).</para>
+ </warning>
+ </refdescription>
+ <refsynopsisdiv>
+ <synopsis><tag class="xmlpi">dbchoice choice="and"|"or"|<replaceable>string</replaceable>"</tag></synopsis>
+ </refsynopsisdiv>
+ <refparameter>
+ <variablelist>
+ <varlistentry><term>choice="and"</term>
+ <listitem>
+ <para>generates a localized <literal>and</literal> separator</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry><term>choice="or"</term>
+ <listitem>
+ <para>generates a localized <literal>or</literal> separator</para>
+ </listitem>
+ </varlistentry>
+ <varlistentry><term>choice="<replaceable>string</replaceable>"</term>
+ <listitem>
+ <para>generates a literal <replaceable>string</replaceable> separator</para>
+ </listitem>
+ </varlistentry>
+ </variablelist>
+ </refparameter>
+</doc:template>
+<xsl:template name="pi.dbchoice_choice">
+ <xsl:param name="node" select="."/>
+ <xsl:call-template name="pi-attribute">
+ <xsl:with-param name="pis" select="$node/processing-instruction('dbchoice')"/>
+ <xsl:with-param name="attribute">choice</xsl:with-param>
+ </xsl:call-template>
+</xsl:template>
+
<doc:pi name="dbtimestamp" xmlns="">
<refpurpose>Inserts a date timestamp</refpurpose>
<refdescription>
</varlistentry>
<varlistentry><term>padding="0"|"1"</term>
<listitem>
- <para>Specifies padding behavior; if non-zer, padding is is added</para>
+ <para>Specifies padding behavior; if non-zero, padding is is added</para>
</listitem>
</varlistentry>
</variablelist>
</refsee>
</doc:pi>
<xsl:template name="pi.dbtex_delims">
+ <xsl:param name="node" select="."/>
<xsl:call-template name="pi-attribute">
<xsl:with-param name="pis" select="$node/processing-instruction('dbtex')"/>
<xsl:with-param name="attribute" select="'delims'"/>
<!-- ==================================================================== -->
-</xsl:stylesheet>
+<xsl:template name="orderedlist-starting-number">
+ <xsl:param name="list" select="."/>
+ <xsl:variable name="pi-start">
+ <xsl:call-template name="pi.dbfo_start">
+ <xsl:with-param name="node" select="$list"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="output-orderedlist-starting-number">
+ <xsl:with-param name="list" select="$list"/>
+ <xsl:with-param name="pi-start" select="$pi-start"/>
+ </xsl:call-template>
+</xsl:template>
+</xsl:stylesheet>
<xsl:variable name="localized-choice-separator">
<xsl:choose>
<xsl:when test="processing-instruction('dbchoice')">
- <xsl:call-template name="select.choice.separator"/>
+ <xsl:call-template name="select.choice.separator"/>
</xsl:when>
<xsl:otherwise>
- <!-- empty -->
+ <!-- empty -->
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<!-- ==================================================================== -->
-</xsl:stylesheet>
+<xsl:template name="orderedlist-starting-number">
+ <xsl:param name="list" select="."/>
+ <xsl:variable name="pi-start">
+ <xsl:call-template name="pi.dbhtml_start">
+ <xsl:with-param name="node" select="$list"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:call-template name="output-orderedlist-starting-number">
+ <xsl:with-param name="list" select="$list"/>
+ <xsl:with-param name="pi-start" select="$pi-start"/>
+ </xsl:call-template>
+</xsl:template>
+</xsl:stylesheet>