diff options
Diffstat (limited to 'stylesheets/lfs-xsl/docbook-xsl-snapshot/common')
13 files changed, 443 insertions, 312 deletions
diff --git a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/common.xsl b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/common.xsl index 484e7ee2d..0f6c378f9 100644 --- a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/common.xsl +++ b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/common.xsl @@ -14,38 +14,24 @@ 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 - versions of the DocBook stylesheets. ******************************************************************** --> -<doc:reference xmlns=""> -<referenceinfo> -<releaseinfo role="meta"> -$Id$ -</releaseinfo> -<author><surname>Walsh</surname> -<firstname>Norman</firstname></author> -<copyright><year>1999-2007</year> -<holder>Norman Walsh</holder> -</copyright> -</referenceinfo> -<title>Common Template Reference</title> - -<partintro id="partintro"> -<title>Introduction</title> - -<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 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> - -</partintro> - +<doc:reference xmlns="" xml:id="base"> + <info> + <title>Common » Base Template Reference</title> + <releaseinfo role="meta"> + $Id$ + </releaseinfo> + </info> + <!-- * yes, partintro is a valid child of a reference... --> + <partintro xml:id="partintro"> + <title>Introduction</title> + <para>This is technical reference documentation for the “base” + set of common templates in the DocBook XSL Stylesheets.</para> + <para>This is not intended to be user documentation. It is + provided for developers writing customization layers for the + stylesheets.</para> + </partintro> </doc:reference> <!-- ==================================================================== --> @@ -183,7 +169,7 @@ manvolnum <refdescription id="section.level-desc"> <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 <tag>sect1</tag> is at level 1, <tag>sect2</tag> is at level 2, etc.</para> <para>Recursive sections are calculated down to the fifth level.</para> @@ -1324,45 +1310,24 @@ pointed to by the link is one of the elements listed in <!-- ====================================================================== --> <!-- 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-attribute"> - <xsl:with-param name="pis" - select="$list/processing-instruction('dbhtml')"/> - <xsl:with-param name="attribute" select="'start'"/> - </xsl:call-template> - </xsl:variable> - - <xsl:variable name="pi-fo-start"> - <xsl:call-template name="pi-attribute"> - <xsl:with-param name="pis" - select="$list/processing-instruction('dbfo')"/> - <xsl:with-param name="attribute" select="'start'"/> - </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> @@ -1382,7 +1347,6 @@ pointed to by the link is one of the elements listed in <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"/> @@ -1903,33 +1867,28 @@ unchanged.</para> 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> + <simpara>if the value of the <tag>choice</tag> pseudo-attribute is "and" or "or", returns a localized "and" or "or"</simpara> </listitem> <listitem> <simpara>otherwise returns the literal value of the - <sgmltag>choice</sgmltag> pseudo-attribute</simpara> + <tag>choice</tag> 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 + <para>The <tag>dbchoice</tag> processing instruction is an unfortunate 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> @@ -1937,14 +1896,9 @@ unchanged.</para> </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 --> @@ -2024,5 +1978,4 @@ engine does not support it. </xsl:otherwise> </xsl:choose> </xsl:template> - </xsl:stylesheet> diff --git a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/de.xml b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/de.xml index 79b2201b1..a8233d13c 100644 --- a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/de.xml +++ b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/de.xml @@ -19,6 +19,13 @@ <!-- copyright and other information. --> <!-- ******************************************************************** --> +<!-- In these files, % with a letter is used for a placeholder: --> +<!-- %t is the current element's title --> +<!-- %s is the current element's subtitle (if applicable)--> +<!-- %n is the current element's number label--> +<!-- %p is the current element's page number (if applicable)--> +<!-- ******************************************************************** --> + <l:gentext key="Abstract" text="Zusammenfassung"/> <l:gentext key="abstract" text="Zusammenfassung"/> diff --git a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/en.xml b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/en.xml index a5ef40079..1aa99856b 100644 --- a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/en.xml +++ b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/en.xml @@ -19,6 +19,13 @@ <!-- copyright and other information. --> <!-- ******************************************************************** --> +<!-- In these files, % with a letter is used for a placeholder: --> +<!-- %t is the current element's title --> +<!-- %s is the current element's subtitle (if applicable)--> +<!-- %n is the current element's number label--> +<!-- %p is the current element's page number (if applicable)--> +<!-- ******************************************************************** --> + <l:gentext key="Abstract" text="Abstract"/> <l:gentext key="abstract" text="Abstract"/> diff --git a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/es.xml b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/es.xml index c6d6bb630..11592e1e8 100644 --- a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/es.xml +++ b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/es.xml @@ -19,6 +19,13 @@ <!-- copyright and other information. --> <!-- ******************************************************************** --> +<!-- In these files, % with a letter is used for a placeholder: --> +<!-- %t is the current element's title --> +<!-- %s is the current element's subtitle (if applicable)--> +<!-- %n is the current element's number label--> +<!-- %p is the current element's page number (if applicable)--> +<!-- ******************************************************************** --> + <l:gentext key="Abstract" text="Resumen"/> <l:gentext key="abstract" text="resumen"/> diff --git a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/fr.xml b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/fr.xml index 5d590f725..58826b96c 100644 --- a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/fr.xml +++ b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/fr.xml @@ -19,6 +19,13 @@ <!-- copyright and other information. --> <!-- ******************************************************************** --> +<!-- In these files, % with a letter is used for a placeholder: --> +<!-- %t is the current element's title --> +<!-- %s is the current element's subtitle (if applicable)--> +<!-- %n is the current element's number label--> +<!-- %p is the current element's page number (if applicable)--> +<!-- ******************************************************************** --> + <l:gentext key="Abstract" text="Résumé"/> <l:gentext key="abstract" text="Résumé"/> diff --git a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/it.xml b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/it.xml index a07b68eea..fc473dfef 100644 --- a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/it.xml +++ b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/it.xml @@ -19,6 +19,13 @@ <!-- copyright and other information. --> <!-- ******************************************************************** --> +<!-- In these files, % with a letter is used for a placeholder: --> +<!-- %t is the current element's title --> +<!-- %s is the current element's subtitle (if applicable)--> +<!-- %n is the current element's number label--> +<!-- %p is the current element's page number (if applicable)--> +<!-- ******************************************************************** --> + <l:gentext key="Abstract" text="Estratto"/> <l:gentext key="abstract" text="Estratto"/> diff --git a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/labels.xsl b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/labels.xsl index 98050d012..38b123a35 100644 --- a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/labels.xsl +++ b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/labels.xsl @@ -193,12 +193,31 @@ element label.</para> <xsl:value-of select="@label"/> </xsl:when> <xsl:when test="string($reference.autolabel) != 0"> + <xsl:if test="$component.label.includes.part.label != 0 and + ancestor::part"> + <xsl:variable name="part.label"> + <xsl:apply-templates select="ancestor::part" + mode="label.markup"/> + </xsl:variable> + <xsl:if test="$part.label != ''"> + <xsl:value-of select="$part.label"/> + <xsl:apply-templates select="ancestor::part" + mode="intralabel.punctuation"/> + </xsl:if> + </xsl:if> <xsl:variable name="format"> <xsl:call-template name="autolabel.format"> <xsl:with-param name="format" select="$reference.autolabel"/> </xsl:call-template> </xsl:variable> - <xsl:number from="book" count="reference" format="{$format}" level="any"/> + <xsl:choose> + <xsl:when test="$label.from.part != 0 and ancestor::part"> + <xsl:number from="part" count="reference" format="{$format}" level="any"/> + </xsl:when> + <xsl:otherwise> + <xsl:number from="book" count="reference" format="{$format}" level="any"/> + </xsl:otherwise> + </xsl:choose> </xsl:when> </xsl:choose> </xsl:template> diff --git a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/pi.xsl b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/pi.xsl index cc2d6c264..5c3df8815 100644 --- a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/pi.xsl +++ b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/pi.xsl @@ -1,11 +1,13 @@ <?xml version='1.0'?> -<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" - xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" - xmlns:date="http://exslt.org/dates-and-times" - xmlns:exsl="http://exslt.org/common" - exclude-result-prefixes="doc date exsl" - extension-element-prefixes="date exsl" - version='1.0'> +<xsl:stylesheet + xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" + xmlns:date="http://exslt.org/dates-and-times" + xmlns:exsl="http://exslt.org/common" + xmlns:xlink="http://www.w3.org/1999/xlink" + exclude-result-prefixes="doc date exsl" + extension-element-prefixes="date exsl" + version='1.0'> <!-- ******************************************************************** $Id$ @@ -15,17 +17,108 @@ 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 both the HTML and FO versions of the - DocBook stylesheets. ******************************************************************** --> -<!-- Process PIs also on title pages --> -<xsl:template match="processing-instruction()" mode="titlepage.mode"> - <xsl:apply-templates select="."/> +<doc:reference xmlns=""><info><title>Common Processing Instruction Reference</title> + <releaseinfo role="meta"> + $Id$ + </releaseinfo> + </info> + <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:pi 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:pi> +<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> -<xsl:template match="processing-instruction('dbtimestamp')"> +<doc:pi name="dbtimestamp" xmlns=""> + <refpurpose>Inserts a date timestamp</refpurpose> + <refdescription> + <para>Use the <tag>dbtimestamp</tag> PI at any point in a + source document to cause a date timestamp (a formatted + string representing the current date and time) to be + inserted in output of the document.</para> + </refdescription> + <refsynopsisdiv> + <synopsis><tag class="xmlpi">dbtimestamp format="<replaceable>formatstring</replaceable>" [padding="0"|"1"]</tag></synopsis> + </refsynopsisdiv> + <refparameter> + <variablelist> + <varlistentry><term>format="<replaceable>formatstring</replaceable>"</term> + <listitem> + <para>Specifies format in which the date and time are + output</para> + <note> + <para>For details of the content of the format string, + see <link role="tcg" xlink:href="Datetime.html" + >Date and time</link>.</para> + </note> + </listitem> + </varlistentry> + <varlistentry><term>padding="0"|"1"</term> + <listitem> + <para>Specifies padding behavior; if non-zero, padding is is added</para> + </listitem> + </varlistentry> + </variablelist> + </refparameter> +</doc:pi> +<xsl:template name="pi.dbtimestamp"> <xsl:variable name="format"> <xsl:variable name="pi-format"> <xsl:call-template name="pi-attribute"> @@ -44,8 +137,7 @@ </xsl:call-template> </xsl:otherwise> </xsl:choose> - </xsl:variable> - + </xsl:variable> <xsl:variable name="padding"> <xsl:variable name="pi-padding"> <xsl:call-template name="pi-attribute"> @@ -60,7 +152,6 @@ <xsl:otherwise>1</xsl:otherwise> </xsl:choose> </xsl:variable> - <xsl:variable name="date"> <xsl:choose> <xsl:when test="function-available('date:date-time')"> @@ -72,10 +163,9 @@ </xsl:when> </xsl:choose> </xsl:variable> - <xsl:choose> <xsl:when test="function-available('date:date-time') or - function-available('date:dateTime')"> + function-available('date:dateTime')"> <xsl:call-template name="datetime.format"> <xsl:with-param name="date" select="$date"/> <xsl:with-param name="format" select="$format"/> @@ -88,124 +178,169 @@ </xsl:message> </xsl:otherwise> </xsl:choose> +</xsl:template> + +<doc:pi name="dbtex_delims" xmlns=""> + <refpurpose>Generates delimiters around embedded TeX equations + in output</refpurpose> + <refdescription> + <para>Use the <tag class="xmlpi">dbtex delims</tag> PI as a + child of a <tag>textobject</tag> containing embedded TeX + markup, to cause that markup to be surrounded by + <literal>$</literal> delimiter characters in output.</para> + </refdescription> + <refsynopsisdiv> + <synopsis><tag class="xmlpi">dbtex delims="no"|"yes"</tag></synopsis> + </refsynopsisdiv> + <refparameter> + <variablelist> + <varlistentry><term>dbtex delims="no"|"yes"</term> + <listitem> + <para>Specifies whether delimiters are output</para> + </listitem> + </varlistentry> + </variablelist> + </refparameter> + <refsee role="params"> + <para><parameter>tex.math.delims</parameter></para> + </refsee> + <refsee role="tcg"> + <para><link role="tcg" + xlink:href="TexMath.html" + >DBTeXMath</link></para> + </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:call-template> +</xsl:template> + +<!-- ==================================================================== --> + +<xsl:template match="processing-instruction()" mode="titlepage.mode"> + <!-- * Als process PIs on title pages --> + <xsl:apply-templates select="."/> +</xsl:template> +<xsl:template match="processing-instruction('dbtimestamp')"> + <xsl:call-template name="pi.dbtimestamp"/> </xsl:template> <xsl:template name="datetime.format"> <xsl:param name="date"/> <xsl:param name="format"/> <xsl:param name="padding" select="1"/> - <xsl:if test="$format != ''"> <!-- replace any whitespace in the format string with a non-breaking space --> <xsl:variable name="format-nbsp" - select="translate($format, - ' 	
', - '    ')"/> + select="translate($format, + ' 	
', + '    ')"/> <xsl:variable name="tokenized-format-string"> <xsl:call-template name="str.tokenize.keep.delimiters"> - <xsl:with-param name="string" select="$format-nbsp"/> - <xsl:with-param name="delimiters" select="' ,./-()[]:'"/> + <xsl:with-param name="string" select="$format-nbsp"/> + <xsl:with-param name="delimiters" select="' ,./-()[]:'"/> </xsl:call-template> </xsl:variable> - - <xsl:choose> - <!-- include extra test for Xalan quirk --> - <xsl:when test="function-available('exsl:node-set') or - contains(system-property('xsl:vendor'),'Apache Software Foundation')"> - <!-- We must preserve context node in order to get valid language --> - <xsl:variable name="context" select="."/> - <xsl:for-each select="exsl:node-set($tokenized-format-string)/node()"> - <xsl:variable name="token"> - <xsl:value-of select="."/> - </xsl:variable> - <!-- Restore context node --> - <xsl:for-each select="$context"> - <xsl:choose> - <xsl:when test="$token = 'a'"> - <xsl:call-template name="gentext.template"> - <xsl:with-param name="context" select="'datetime-abbrev'"/> - <xsl:with-param name="name" select="date:day-abbreviation($date)"/> - </xsl:call-template> - </xsl:when> - <xsl:when test="$token = 'A'"> - <xsl:call-template name="gentext.template"> - <xsl:with-param name="context" select="'datetime-full'"/> - <xsl:with-param name="name" select="date:day-name($date)"/> - </xsl:call-template> - </xsl:when> - <xsl:when test="$token = 'b'"> - <xsl:call-template name="gentext.template"> - <xsl:with-param name="context" select="'datetime-abbrev'"/> - <xsl:with-param name="name" select="date:month-abbreviation($date)"/> - </xsl:call-template> - </xsl:when> - <xsl:when test="$token = 'c'"> - <xsl:value-of select="date:date($date)"/> - <xsl:text> </xsl:text> - <xsl:value-of select="date:time($date)"/> - </xsl:when> - <xsl:when test="$token = 'B'"> - <xsl:call-template name="gentext.template"> - <xsl:with-param name="context" select="'datetime-full'"/> - <xsl:with-param name="name" select="date:month-name($date)"/> - </xsl:call-template> - </xsl:when> - <xsl:when test="$token = 'd'"> - <xsl:if test="$padding = 1 and - string-length(date:day-in-month($date)) = 1">0</xsl:if> - <xsl:value-of select="date:day-in-month($date)"/> - </xsl:when> - <xsl:when test="$token = 'H'"> - <xsl:if test="$padding = 1 and string-length(date:hour-in-day($date)) = 1">0</xsl:if> - <xsl:value-of select="date:hour-in-day($date)"/> - </xsl:when> - <xsl:when test="$token = 'j'"> - <xsl:value-of select="date:day-in-year($date)"/> - </xsl:when> - <xsl:when test="$token = 'm'"> - <xsl:if test="$padding = 1 and string-length(date:month-in-year($date)) = 1">0</xsl:if> - <xsl:value-of select="date:month-in-year($date)"/> - </xsl:when> - <xsl:when test="$token = 'M'"> - <xsl:if test="string-length(date:minute-in-hour($date)) = 1">0</xsl:if> - <xsl:value-of select="date:minute-in-hour($date)"/> - </xsl:when> - <xsl:when test="$token = 'S'"> - <xsl:if test="string-length(date:second-in-minute($date)) = 1">0</xsl:if> - <xsl:value-of select="date:second-in-minute($date)"/> - </xsl:when> - <xsl:when test="$token = 'U'"> - <xsl:value-of select="date:week-in-year($date)"/> - </xsl:when> - <xsl:when test="$token = 'w'"> - <xsl:value-of select="date:day-in-week($date)"/> - </xsl:when> - <xsl:when test="$token = 'x'"> - <xsl:value-of select="date:date($date)"/> - </xsl:when> - <xsl:when test="$token = 'X'"> - <xsl:value-of select="date:time($date)"/> - </xsl:when> - <xsl:when test="$token = 'Y'"> - <xsl:value-of select="date:year($date)"/> - </xsl:when> - <xsl:otherwise> - <xsl:value-of select="$token"/> - </xsl:otherwise> - </xsl:choose> + <xsl:choose> + <!-- include extra test for Xalan quirk --> + <xsl:when test="function-available('exsl:node-set') or + contains(system-property('xsl:vendor'),'Apache Software Foundation')"> + <!-- We must preserve context node in order to get valid language --> + <xsl:variable name="context" select="."/> + <xsl:for-each select="exsl:node-set($tokenized-format-string)/node()"> + <xsl:variable name="token"> + <xsl:value-of select="."/> + </xsl:variable> + <!-- Restore context node --> + <xsl:for-each select="$context"> + <xsl:choose> + <xsl:when test="$token = 'a'"> + <xsl:call-template name="gentext.template"> + <xsl:with-param name="context" select="'datetime-abbrev'"/> + <xsl:with-param name="name" select="date:day-abbreviation($date)"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$token = 'A'"> + <xsl:call-template name="gentext.template"> + <xsl:with-param name="context" select="'datetime-full'"/> + <xsl:with-param name="name" select="date:day-name($date)"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$token = 'b'"> + <xsl:call-template name="gentext.template"> + <xsl:with-param name="context" select="'datetime-abbrev'"/> + <xsl:with-param name="name" select="date:month-abbreviation($date)"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$token = 'c'"> + <xsl:value-of select="date:date($date)"/> + <xsl:text> </xsl:text> + <xsl:value-of select="date:time($date)"/> + </xsl:when> + <xsl:when test="$token = 'B'"> + <xsl:call-template name="gentext.template"> + <xsl:with-param name="context" select="'datetime-full'"/> + <xsl:with-param name="name" select="date:month-name($date)"/> + </xsl:call-template> + </xsl:when> + <xsl:when test="$token = 'd'"> + <xsl:if test="$padding = 1 and + string-length(date:day-in-month($date)) = 1">0</xsl:if> + <xsl:value-of select="date:day-in-month($date)"/> + </xsl:when> + <xsl:when test="$token = 'H'"> + <xsl:if test="$padding = 1 and string-length(date:hour-in-day($date)) = 1">0</xsl:if> + <xsl:value-of select="date:hour-in-day($date)"/> + </xsl:when> + <xsl:when test="$token = 'j'"> + <xsl:value-of select="date:day-in-year($date)"/> + </xsl:when> + <xsl:when test="$token = 'm'"> + <xsl:if test="$padding = 1 and string-length(date:month-in-year($date)) = 1">0</xsl:if> + <xsl:value-of select="date:month-in-year($date)"/> + </xsl:when> + <xsl:when test="$token = 'M'"> + <xsl:if test="string-length(date:minute-in-hour($date)) = 1">0</xsl:if> + <xsl:value-of select="date:minute-in-hour($date)"/> + </xsl:when> + <xsl:when test="$token = 'S'"> + <xsl:if test="string-length(date:second-in-minute($date)) = 1">0</xsl:if> + <xsl:value-of select="date:second-in-minute($date)"/> + </xsl:when> + <xsl:when test="$token = 'U'"> + <xsl:value-of select="date:week-in-year($date)"/> + </xsl:when> + <xsl:when test="$token = 'w'"> + <xsl:value-of select="date:day-in-week($date)"/> + </xsl:when> + <xsl:when test="$token = 'x'"> + <xsl:value-of select="date:date($date)"/> + </xsl:when> + <xsl:when test="$token = 'X'"> + <xsl:value-of select="date:time($date)"/> + </xsl:when> + <xsl:when test="$token = 'Y'"> + <xsl:value-of select="date:year($date)"/> + </xsl:when> + <xsl:otherwise> + <xsl:value-of select="$token"/> + </xsl:otherwise> + </xsl:choose> + </xsl:for-each> </xsl:for-each> - </xsl:for-each> - </xsl:when> - <xsl:otherwise> - <xsl:message> - Timestamp processing requires an XSLT processor with support - for the EXSLT node-set() function. - </xsl:message> - </xsl:otherwise> - </xsl:choose> + </xsl:when> + <xsl:otherwise> + <xsl:message> + Timestamp processing requires an XSLT processor with support + for the EXSLT node-set() function. + </xsl:message> + </xsl:otherwise> + </xsl:choose> </xsl:if> - </xsl:template> </xsl:stylesheet> diff --git a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/refentry.xsl b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/refentry.xsl index 4373e4849..892b9fb72 100644 --- a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/refentry.xsl +++ b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/refentry.xsl @@ -16,36 +16,25 @@ ******************************************************************** --> <!-- ==================================================================== --> -<doc:reference xmlns=""> - <referenceinfo> +<doc:reference xmlns="" xml:id="refentry"> + <info> + <title>Common » Refentry Metadata Template Reference</title> <releaseinfo role="meta"> $Id$ </releaseinfo> - <corpauthor>The DocBook Project</corpauthor> - <copyright> - <year>2005-2007</year> - <holder>The DocBook Project</holder> - </copyright> - </referenceinfo> - <title>Refentry Metadata-Gathering Template Reference</title> - - <partintro id="partintro"> + </info> + <!-- * yes, partintro is a valid child of a reference... --> + <partintro xml:id="partintro"> <title>Introduction</title> - - <para>This is technical reference documentation for the "refentry - metadata gathering" templates in the DocBook XSL Stylesheets.</para> - + <para>This is technical reference documentation for the “refentry + metadata” templates in the DocBook XSL Stylesheets.</para> <para>This is not intended to be user documentation. It is provided - for developers writing customization layers for the - stylesheets.</para> - + for developers writing customization layers for the stylesheets.</para> <note> <para>Currently, only the manpages stylesheets make use of these templates. They are, however, potentially useful elsewhere.</para> </note> - </partintro> - </doc:reference> <!-- ==================================================================== --> @@ -56,27 +45,27 @@ 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 <sgmltag>refentry</sgmltag>.</para> + embed "context" information in output for each <tag>refentry</tag>.</para> <para>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 - <sgmltag>refentry</sgmltag> itself, but instead part of the content of a - parent or ancestor element to the the <sgmltag>refentry</sgmltag>. And + <tag>refentry</tag> itself, but instead part of the content of a + parent or ancestor element to the the <tag>refentry</tag>. 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 <sgmltag>productnumber</sgmltag> element to mark up version + might use the <tag>productnumber</tag> element to mark up version information about a particular product, while another might use - the <sgmltag>releaseinfo</sgmltag> element.</para> + the <tag>releaseinfo</tag> element.</para> <para>Taking all that in mind, the <function>get.refentry.metadata</function> template tries to gather - metadata from a <sgmltag>refentry</sgmltag> element and its ancestor + metadata from a <tag>refentry</tag> 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 <sgmltag>refentry</sgmltag> – either on the - <sgmltag>refentry</sgmltag> itself, or on its nearest ancestor.</para> + closest to the actual <tag>refentry</tag> – either on the + <tag>refentry</tag> itself, or on its nearest ancestor.</para> <note> <para>The <function>get.refentry.metadata</function> @@ -91,13 +80,13 @@ <varlistentry> <term>refname</term> <listitem> - <para>The first <sgmltag>refname</sgmltag> in the refentry</para> + <para>The first <tag>refname</tag> in the refentry</para> </listitem> </varlistentry> <varlistentry> <term>info</term> <listitem> - <para>A set of info nodes (from a <sgmltag>refentry</sgmltag> + <para>A set of info nodes (from a <tag>refentry</tag> element and its ancestors)</para> </listitem> </varlistentry> @@ -194,23 +183,23 @@ <refdescription id="get.refentry.title-desc"> <para>The <literal>man(7)</literal> man page describes this as "the title of the man page (e.g., <literal>MAN</literal>). This differs - from <sgmltag>refname</sgmltag> in that, if the <sgmltag>refentry</sgmltag> has a - <sgmltag>refentrytitle</sgmltag>, we use that as the <sgmltag>title</sgmltag>; - otherwise, we just use first <sgmltag>refname</sgmltag> in the first - <sgmltag>refnamediv</sgmltag> in the source.</para> + from <tag>refname</tag> in that, if the <tag>refentry</tag> has a + <tag>refentrytitle</tag>, we use that as the <tag>title</tag>; + otherwise, we just use first <tag>refname</tag> in the first + <tag>refnamediv</tag> in the source.</para> </refdescription> <refparameter id="get.refentry.title-params"> <variablelist> <varlistentry> <term>refname</term> <listitem> - <para>The first <sgmltag>refname</sgmltag> in the refentry</para> + <para>The first <tag>refname</tag> in the refentry</para> </listitem> </varlistentry> </variablelist> </refparameter> <refreturn id="get.refentry.title-returns"> - <para>Returns a <sgmltag>title</sgmltag> node.</para></refreturn> + <para>Returns a <tag>title</tag> node.</para></refreturn> </doc:template> <xsl:template name="get.refentry.title"> <xsl:param name="refname"/> @@ -232,8 +221,8 @@ <refdescription id="get.refentry.section-desc"> <para>The <literal>man(7)</literal> man page describes this as "the section number the man page should be placed in (e.g., - <literal>7</literal>)". If we do not find a <sgmltag>manvolnum</sgmltag> - specified in the source, and we find that the <sgmltag>refentry</sgmltag> is + <literal>7</literal>)". If we do not find a <tag>manvolnum</tag> + specified in the source, and we find that the <tag>refentry</tag> is for a function, we use the section number <literal>3</literal> ["Library calls (functions within program libraries)"]; otherwise, we default to using <literal>1</literal> ["Executable programs or shell @@ -244,7 +233,7 @@ <varlistentry> <term>refname</term> <listitem> - <para>The first <sgmltag>refname</sgmltag> in the refentry</para> + <para>The first <tag>refname</tag> in the refentry</para> </listitem> </varlistentry> <varlistentry> @@ -323,13 +312,13 @@ <varlistentry> <term>refname</term> <listitem> - <para>The first <sgmltag>refname</sgmltag> in the refentry</para> + <para>The first <tag>refname</tag> in the refentry</para> </listitem> </varlistentry> <varlistentry> <term>info</term> <listitem> - <para>A set of info nodes (from a <sgmltag>refentry</sgmltag> + <para>A set of info nodes (from a <tag>refentry</tag> element and its ancestors)</para> </listitem> </varlistentry> @@ -342,7 +331,7 @@ </variablelist> </refparameter> <refreturn id="get.refentry.date-returns"> - <para>Returns a <sgmltag>date</sgmltag> node.</para> + <para>Returns a <tag>date</tag> node.</para> </refreturn> </doc:template> <xsl:template name="get.refentry.date"> @@ -495,13 +484,13 @@ <varlistentry> <term>refname</term> <listitem> - <para>The first <sgmltag>refname</sgmltag> in the refentry</para> + <para>The first <tag>refname</tag> in the refentry</para> </listitem> </varlistentry> <varlistentry> <term>info</term> <listitem> - <para>A set of info nodes (from a <sgmltag>refentry</sgmltag> + <para>A set of info nodes (from a <tag>refentry</tag> element and its ancestors)</para> </listitem> </varlistentry> @@ -515,7 +504,7 @@ </variablelist> </refparameter> <refreturn id="get.refentry.source-returns"> - <para>Returns a <sgmltag>source</sgmltag> node.</para> + <para>Returns a <tag>source</tag> node.</para> </refreturn> </doc:template> <xsl:template name="get.refentry.source"> @@ -611,13 +600,13 @@ <varlistentry> <term>refname</term> <listitem> - <para>The first <sgmltag>refname</sgmltag> in the refentry</para> + <para>The first <tag>refname</tag> in the refentry</para> </listitem> </varlistentry> <varlistentry> <term>info</term> <listitem> - <para>A set of info nodes (from a <sgmltag>refentry</sgmltag> + <para>A set of info nodes (from a <tag>refentry</tag> element and its ancestors)</para> </listitem> </varlistentry> @@ -795,13 +784,13 @@ <varlistentry> <term>refname</term> <listitem> - <para>The first <sgmltag>refname</sgmltag> in the refentry</para> + <para>The first <tag>refname</tag> in the refentry</para> </listitem> </varlistentry> <varlistentry> <term>info</term> <listitem> - <para>A set of info nodes (from a <sgmltag>refentry</sgmltag> + <para>A set of info nodes (from a <tag>refentry</tag> element and its ancestors)</para> </listitem> </varlistentry> @@ -981,13 +970,13 @@ <varlistentry> <term>refname</term> <listitem> - <para>The first <sgmltag>refname</sgmltag> in the refentry</para> + <para>The first <tag>refname</tag> in the refentry</para> </listitem> </varlistentry> <varlistentry> <term>info</term> <listitem> - <para>A set of info nodes (from a <sgmltag>refentry</sgmltag> + <para>A set of info nodes (from a <tag>refentry</tag> element and its ancestors)</para> </listitem> </varlistentry> @@ -1001,7 +990,7 @@ </variablelist> </refparameter> <refreturn id="get.refentry.manual-returns"> - <para>Returns a <sgmltag>manual</sgmltag> node.</para> + <para>Returns a <tag>manual</tag> node.</para> </refreturn> </doc:template> <xsl:template name="get.refentry.manual"> @@ -1140,25 +1129,25 @@ <refpurpose>Gets user preferences for refentry metadata gathering</refpurpose> <refdescription id="get.refentry.metadata.prefs-desc"> <para>The DocBook XSL stylesheets include several user-configurable - global stylesheet parameters for controlling <sgmltag>refentry</sgmltag> + global stylesheet parameters for controlling <tag>refentry</tag> metadata gathering. Those parameters are not read directly by the - other <sgmltag>refentry</sgmltag> metadata-gathering + other <tag>refentry</tag> metadata-gathering templates. Instead, they are read only by the <function>get.refentry.metadata.prefs</function> template, which assembles them into a structure that is then passed to - the other <sgmltag>refentry</sgmltag> metadata-gathering + the other <tag>refentry</tag> metadata-gathering templates.</para> <para>So the, <function>get.refentry.metadata.prefs</function> template is the only interface to collecting stylesheet parameters for - controlling <sgmltag>refentry</sgmltag> metadata gathering.</para> + controlling <tag>refentry</tag> metadata gathering.</para> </refdescription> <refparameter id="get.refentry.metadata.prefs-params"> <para>There are no local parameters for this template; however, it does rely on a number of global parameters.</para> </refparameter> <refreturn id="get.refentry.metadata.prefs-returns"> - <para>Returns a <sgmltag>manual</sgmltag> node.</para> + <para>Returns a <tag>manual</tag> node.</para> </refreturn> </doc:template> <xsl:template name="get.refentry.metadata.prefs"> @@ -1223,7 +1212,7 @@ <varlistentry> <term>refname</term> <listitem> - <para>The first <sgmltag>refname</sgmltag> in the refentry</para> + <para>The first <tag>refname</tag> in the refentry</para> </listitem> </varlistentry> <varlistentry> diff --git a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/table.xsl b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/table.xsl index 9c0c49844..562d3412a 100644 --- a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/table.xsl +++ b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/table.xsl @@ -124,17 +124,17 @@ <doc:template name="entry.colnum" xmlns=""> <refpurpose>Determine the column number in which a given entry occurs</refpurpose> <refdescription id="entry.colnum-desc"> -<para>If an <sgmltag>entry</sgmltag> has a -<sgmltag class="attribute">colname</sgmltag> or -<sgmltag class="attribute">namest</sgmltag> attribute, this template +<para>If an <tag>entry</tag> has a +<tag class="attribute">colname</tag> or +<tag class="attribute">namest</tag> attribute, this template will determine the number of the column in which the entry should occur. -For other <sgmltag>entry</sgmltag>s, nothing is returned.</para> +For other <tag>entry</tag>s, nothing is returned.</para> </refdescription> <refparameter id="entry.colnum-params"> <variablelist> <varlistentry><term>entry</term> <listitem> -<para>The <sgmltag>entry</sgmltag>-element which is to be tested.</para> +<para>The <tag>entry</tag>-element which is to be tested.</para> </listitem> </varlistentry> </variablelist> diff --git a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/utility.xsl b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/utility.xsl index 8f9fadd9f..f6b3a0186 100644 --- a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/utility.xsl +++ b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/utility.xsl @@ -3,6 +3,7 @@ xmlns:doc="http://nwalsh.com/xsl/documentation/1.0" xmlns:dyn="http://exslt.org/dynamic" xmlns:saxon="http://icl.com/saxon" + xmlns:xlink="http://www.w3.org/1999/xlink" exclude-result-prefixes="doc dyn saxon" version='1.0'> @@ -15,42 +16,33 @@ copyright and other information. ******************************************************************** --> - -<doc:reference xmlns=""> -<referenceinfo> -<releaseinfo role="meta"> -$Id$ -</releaseinfo> -<corpauthor>The DocBook Project Development Team</corpauthor> -<copyright><year>2007</year> -<holder>The DocBook Project</holder> -</copyright> -</referenceinfo> -<title>Utility Template Reference</title> - -<partintro id="partintro"> -<title>Introduction</title> - -<para>This is technical reference documentation for the - miscellaneous utility templates in the DocBook XSL - Stylesheets.</para> - -<note> -<para>These templates are defined in a separate file from the set - of “common” templates because some of the comment templates - reference DocBook XSL stylesheet parameters, requiring the - entire set of parameters to be imported/included in any - stylesheet that imports/includes the common templates.</para> -<para>The utility templates don’t import or include any DocBook - XSL stylesheet parameters, so the utility templates can be used - without importing the whole set of parameters.</para> -</note> - -<para>The following 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> -</partintro> +<doc:reference xmlns="" xml:id="utility"> + <info> + <title>Common » Utility Template Reference</title> + <releaseinfo role="meta"> + $Id$ + </releaseinfo> + </info> + <!-- * yes, partintro is a valid child of a reference... --> + <partintro xml:id="partintro"> + <title>Introduction</title> + <para>This is technical reference documentation for the + miscellaneous utility templates in the DocBook XSL + Stylesheets.</para> + <note> + <para>These templates are defined in a separate file from the set + of “common” templates because some of the comment templates + reference DocBook XSL stylesheet parameters, requiring the + entire set of parameters to be imported/included in any + stylesheet that imports/includes the common templates.</para> + <para>The utility templates don’t import or include any DocBook + XSL stylesheet parameters, so the utility templates can be used + without importing the whole set of parameters.</para> + </note> + <para>This is not intended to be user documentation. It is + provided for developers writing customization layers for the + stylesheets.</para> + </partintro> </doc:reference> <!-- ====================================================================== --> @@ -67,8 +59,7 @@ $Id$ <refparameter id="log.message-params"> <variablelist> - <varlistentry> - <term>level</term> + <varlistentry><term>level</term> <listitem> <para>Text to log/emit in the message-level field to indicate the message level @@ -76,8 +67,7 @@ $Id$ <literal>Warning</literal>)</para> </listitem> </varlistentry> - <varlistentry> - <term>source</term> + <varlistentry><term>source</term> <listitem> <para>Text to log/emit in the source field to identify the “source” to which the notification/warning relates. @@ -96,15 +86,13 @@ $Id$ XPath expression.</para> </listitem> </varlistentry> - <varlistentry> - <term>context-desc</term> + <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> + <varlistentry><term>context-desc-field-length</term> <listitem> <para>Specifies length of the context-description field (in characters); default is 12</para> @@ -126,14 +114,12 @@ $Id$ parameter.</para> </listitem> </varlistentry> - <varlistentry> - <term>message</term> + <varlistentry><term>message</term> <listitem> <para>Text to log/emit in the actual message field</para> </listitem> </varlistentry> - <varlistentry> - <term>message-field-length</term> + <varlistentry><term>message-field-length</term> <listitem> <para>Specifies length of the message field (in characters); default is 45</para> @@ -255,11 +241,11 @@ $Id$ 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> + <function>prepend-pad</function> function in the <link + xlink:href="http://www.dpawson.co.uk/xsl/sect2/padding.html" >Padding + Content</link> section of Dave Pawson's <link + xlink:href="http://www.dpawson.co.uk/xsl/index.html" >XSLT + FAQ</link>.</para> </note> </refdescription> <refreturn id="pad-string-returns"> diff --git a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/zh_cn.xml b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/zh_cn.xml index 9f1c8d431..6a782fca0 100644 --- a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/zh_cn.xml +++ b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/zh_cn.xml @@ -19,6 +19,13 @@ <!-- copyright and other information. --> <!-- ******************************************************************** --> +<!-- In these files, % with a letter is used for a placeholder: --> +<!-- %t is the current element's title --> +<!-- %s is the current element's subtitle (if applicable)--> +<!-- %n is the current element's number label--> +<!-- %p is the current element's page number (if applicable)--> +<!-- ******************************************************************** --> + <l:gentext key="Abstract" text="摘要"/> <l:gentext key="abstract" text="摘要"/> diff --git a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/zh_tw.xml b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/zh_tw.xml index fbc52f415..db63cdca5 100644 --- a/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/zh_tw.xml +++ b/stylesheets/lfs-xsl/docbook-xsl-snapshot/common/zh_tw.xml @@ -19,6 +19,13 @@ <!-- copyright and other information. --> <!-- ******************************************************************** --> +<!-- In these files, % with a letter is used for a placeholder: --> +<!-- %t is the current element's title --> +<!-- %s is the current element's subtitle (if applicable)--> +<!-- %n is the current element's number label--> +<!-- %p is the current element's page number (if applicable)--> +<!-- ******************************************************************** --> + <l:gentext key="Abstract" text="摘要"/> <l:gentext key="abstract" text="摘要"/> |