]> granicus.if.org Git - docbook-dsssl/commitdiff
Added doc for the dbchoice choice PI, and fixes some problems with
authorMichael Smith <xmldoc@users.sourceforge.net>
Sat, 7 Jul 2007 08:15:38 +0000 (08:15 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Sat, 7 Jul 2007 08:15:38 +0000 (08:15 +0000)
the db* start PI handling.

xsl/common/common.xsl
xsl/common/pi.xsl
xsl/fo/lists.xsl
xsl/html/lists.xsl

index 4ce1129920a068c9535b69a5b73bc049eefb6bc3..30476ef6e99fce010c0e676b11711daf445fe9a0 100644 (file)
@@ -1324,38 +1324,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.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>
@@ -1375,7 +1361,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"/>
@@ -1896,10 +1881,8 @@ 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 &lt;?dbchoice&#xa0;choice="foo"?> :
-
     <itemizedlist>
       <listitem>
         <simpara>if the value of the <sgmltag>choice</sgmltag>
@@ -1911,16 +1894,13 @@ unchanged.</para>
         <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>&lt;?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
@@ -1930,14 +1910,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 -->
@@ -2017,5 +1992,4 @@ engine does not support it.
       </xsl:otherwise>
     </xsl:choose>
   </xsl:template>
-
 </xsl:stylesheet>
index da20e3fae48b07fded486911a5063d6adb707915..f048e91f63fa7fa7d55fa8ddba6de7fbcc10cd89 100644 (file)
      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'"/>
index ee31ed09329afcbf89a72479e8bd2e7ce37e59eb..ffdfaec9adac62525165f7d27c292d60ca4a2ec0 100644 (file)
 
 <!-- ==================================================================== -->
 
-</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>
index a6edfb9c21bd94dbe29b0945ceb4babbec8caa8f..966d7c40751d534127d937461c4d9578641a6893 100644 (file)
   <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>