]> granicus.if.org Git - docbook-dsssl/commitdiff
Drastically reworked all of the XPath expressions used in refentry
authorMichael Smith <xmldoc@users.sourceforge.net>
Fri, 7 Apr 2006 12:21:25 +0000 (12:21 +0000)
committerMichael Smith <xmldoc@users.sourceforge.net>
Fri, 7 Apr 2006 12:21:25 +0000 (12:21 +0000)
metadata gathering -- completely removed $parentinfo and turned
$info into a set of nodes that includes the *info contents of the
Refentry plus the *info contents all all of its ancestor
elements. The basic XPath expression now used throughout is (using
the example of checking for a date):

  (($info[//date])[last()]/date)[1].

That selects the "last" *info/date date in document order -- that
is, the one eitther on the Refentry itself or on the closest
ancestor to the Refentry.

It's likely this change may break some things; may need to pick
up some pieces later.

Also, changed the default value for the man.th.extra2.max.length
from 40 to 30.

xsl/common/common.xsl
xsl/common/refentry.xsl
xsl/manpages/docbook.xsl
xsl/manpages/other.xsl
xsl/params/man.th.extra2.max.length.xml
xsl/params/refentry.date.profile.xml
xsl/params/refentry.manual.profile.xml
xsl/params/refentry.source.name.profile.xml
xsl/params/refentry.version.profile.xml

index 7260592a9bb282d2e338e2244b5b9950c5dc2551..6b86769e5536a889e74aa0029f68c07a101b8e77 100644 (file)
@@ -1944,13 +1944,13 @@ unchanged.</para>
     extension function.</para>
 
     <para>The value of the <parameter>profile</parameter> parameter
-    can include the strings <literal>$info</literal> and
-    <literal>$parentinfo</literal>. If found in the value of the
-    <parameter>profile</parameter> parameter, those strings are
-    evaluated using the <parameter>info</parameter> and
-    <parameter>parentinfo</parameter> parameters, the values of which
-    should be DocBook <replaceable>*info</replaceable> element node
-    sets.</para>
+    can include the literal string <literal>$info</literal>. If found
+    in the value of the <parameter>profile</parameter> parameter, the
+    literal string <literal>$info</literal> string is replaced with
+    the value of the <parameter>info</parameter> parameter, which
+    should be a set of <replaceable>*info</replaceable> nodes; the
+    expression is then evaluated using the XSLT
+    <function>evaluate()</function> extension function.</para>
   </refdescription>
   <refparameter>
     <variablelist>
@@ -1963,13 +1963,7 @@ unchanged.</para>
        <varlistentry>
         <term>info</term>
         <listitem>
-          <para>A DocBook info node</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>parentinfo</term>
-        <listitem>
-          <para>A DocBook info node (from a parent element)</para>
+          <para>A set of *info nodes</para>
         </listitem>
       </varlistentry>
     </variablelist>
@@ -1984,17 +1978,16 @@ unchanged.</para>
   <xsl:template name="evaluate.info.profile">
     <xsl:param name="profile"/>
     <xsl:param name="info"/>
-    <xsl:param name="parentinfo"/>
     <xsl:choose>
-      <!-- xsltproc and Xalan both support dyn:evaluate() -->
+      <!-- xsltproc and Xalan both support dyn:evaluate() -->
       <xsl:when test="function-available('dyn:evaluate')">
         <xsl:apply-templates
-            select="dyn:evaluate($profile)"/>
+            select="dyn:evaluate($profile)" mode="get.refentry.metadata"/>
       </xsl:when>
-      <!-- Saxon has its own evaluate() & doesn't support dyn:evaluate() -->
+      <!-- Saxon has its own evaluate() & doesn't support dyn:evaluate() -->
       <xsl:when test="function-available('saxon:evaluate')">
         <xsl:apply-templates
-            select="saxon:evaluate($profile)"/>
+            select="saxon:evaluate($profile)" mode="get.refentry.metadata"/>
       </xsl:when>
       <xsl:otherwise>
         <xsl:message terminate="yes">
index 987121aaca7a1196954e4c973746d468766f65c7..7301eb8e0bf3863dc71bb081946e54fc3a278ed4 100644 (file)
@@ -52,7 +52,7 @@
 <!-- ==================================================================== -->
 
 <doc:template name="get.refentry.metadata" xmlns="">
-  <refpurpose>Gathers metadata from a refentry and its parent</refpurpose>
+  <refpurpose>Gathers metadata from a refentry and its ancestors</refpurpose>
 
   <refdescription>
     <para>Reference documentation for particular commands, functions,
     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), it is not
-    actually part of the content of the <tag>refentry</tag> itself,
-    but instead part of its parent element's content. And even then,
-    DocBook provides a variety of elements that users might
+    context information in different ways. Often (usually), the
+    context information is not actually part of the content of the
+    <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 <tag>productnumber</tag> element to mark up version
     information about a particular product, while another might use
 
     <para>Taking all that in mind, the
     <function>get.refentry.info</function> function tries to gather
-    metadata from a <tag>refentry</tag> element and its parent element
-    in an intelligent and user-configurable way.</para>
+    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 <tag>refentry</tag>&#160;– either on the
+    <tag>refentry</tag> itself, or on its nearest ancestor.</para>
 
     <note>
-      <para>The <function>get.refentry.info</function> is actually just
-      sort of a "driver" function; it calls other function that do the
-      actual data collection, then returns the data as a set.</para>
+      <para>The <function>get.refentry.info</function> function is
+      actually just sort of a "driver" function; it calls other
+      functions that do the actual data collection, then returns the
+      data as a set.</para>
     </note>
 
-    <para>The manpages stylesheets are an application of these APIs.</para>
+    <para>The manpages stylesheets are an application of the “APIs” in
+    this stylesheet.</para>
   </refdescription>
 
   <refparameter>
       <varlistentry>
         <term>info</term>
         <listitem>
-          <para>An info node (from a <tag>refentry</tag> element)</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>parentinfo</term>
-        <listitem>
-          <para>An info node (from a parent of a <tag>refentry</tag>
-          element)</para>
+          <para>A set of info nodes (from a <tag>refentry</tag>
+          element and its ancestors)</para>
         </listitem>
       </varlistentry>
       <varlistentry>
 <xsl:template name="get.refentry.metadata">
   <xsl:param name="refname"/>
   <xsl:param name="info"/>
-  <xsl:param name="parentinfo"/>
   <xsl:param name="prefs"/>
   <title>
     <xsl:call-template name="get.refentry.title">
   <date>
     <xsl:call-template name="get.refentry.date">
       <xsl:with-param name="info" select="$info"/>
-      <xsl:with-param name="parentinfo" select="$parentinfo"/>
       <xsl:with-param name="prefs" select="$prefs/DatePrefs"/>
     </xsl:call-template>
   </date>
   <source>
     <xsl:call-template name="get.refentry.source">
       <xsl:with-param name="info" select="$info"/>
-      <xsl:with-param name="parentinfo" select="$parentinfo"/>
       <xsl:with-param name="prefs" select="$prefs/SourcePrefs"/>
     </xsl:call-template>
   </source>
   <manual>
     <xsl:call-template name="get.refentry.manual">
       <xsl:with-param name="info" select="$info"/>
-      <xsl:with-param name="parentinfo" select="$parentinfo"/>
       <xsl:with-param name="prefs" select="$prefs/ManualPrefs"/>
     </xsl:call-template>
   </manual>
       <varlistentry>
         <term>info</term>
         <listitem>
-          <para>An info node (from a <tag>refentry</tag> element)</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>parentinfo</term>
-        <listitem>
-          <para>An info node (from a parent of a <tag>refentry</tag> element)</para>
+          <para>A set of info nodes (from a <tag>refentry</tag>
+          element and its ancestors)</para>
         </listitem>
       </varlistentry>
       <varlistentry>
 
 <xsl:template name="get.refentry.date">
   <xsl:param name="info"/>
-  <xsl:param name="parentinfo"/>
   <xsl:param name="prefs"/>
   <xsl:variable name="Date">
     <xsl:choose>
         <xsl:call-template name="evaluate.info.profile">
           <xsl:with-param name="profile" select="$prefs/@profile"/>
           <xsl:with-param name="info" select="$info"/>
-          <xsl:with-param name="parentinfo" select="$parentinfo"/>
         </xsl:call-template>
       </xsl:when>
       <xsl:otherwise>
         <!-- * either profiling is not enabled for date, or the-->
         <!-- * date profile is empty, so we need to look for date -->
-        <!-- * first in *info, then in parentinfo -->
+        <!-- * in *info -->
         <xsl:choose>
           <!-- * look for date or pubdate in *info -->
-          <xsl:when test="$info/date
-                          |$info/pubdate">
+          <xsl:when test="$info//date
+                          |$info//pubdate">
             <xsl:message
                 >Note: Found <xsl:value-of
-                select="local-name(($info/date|$info/pubdate)[1])"
-                /> in <xsl:value-of
-                select="local-name($info)"
+                select="local-name((($info[//date])[last()]/date)[1]|
+                          (($info[//pubdate])[last()]/pubdate)[1])"
+                          /> in <xsl:value-of select="local-name(
+                          ($info[//date])[last()]|
+                          ($info[//pubdate])[last()])"
                 /></xsl:message>
             <xsl:copy>
               <xsl:apply-templates
-                  select="($info/date
-                          |$info/pubdate)[1]/node()"/>
-            </xsl:copy>
-          </xsl:when>
-          <!-- * look for date or pubdate in parentinfo -->
-          <xsl:when test="$parentinfo/date
-                          |$parentinfo/pubdate">
-            <xsl:message
-                >Note: Found <xsl:value-of
-                select="local-name(($parentinfo/date|$parentinfo/pubdate)[1])"
-                /> in <xsl:value-of
-                select="local-name($parentinfo)"
-                /></xsl:message>
-            <xsl:copy>
-              <xsl:apply-templates
-                  select="($parentinfo/date
-                          |$parentinfo/pubdate)[1]/node()"/>
+                  select="(($info[//date])[last()]/date)[1]|
+                          (($info[//pubdate])[last()]/pubdate)[1]" mode="get.refentry.metadata"/>
             </xsl:copy>
           </xsl:when>
           <xsl:otherwise>
       <varlistentry>
         <term>info</term>
         <listitem>
-          <para>An info node (from a <tag>refentry</tag> element)</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>parentinfo</term>
-        <listitem>
-          <para>An info node (from a parent of a <tag>refentry</tag> element)</para>
+          <para>A set of info nodes (from a <tag>refentry</tag>
+          element and its ancestors)</para>
         </listitem>
       </varlistentry>
       <varlistentry>
 
 <xsl:template name="get.refentry.source">
   <xsl:param name="info"/>
-  <xsl:param name="parentinfo"/>
   <xsl:param name="prefs"/>
   <xsl:variable name="Name">
     <xsl:if test="$prefs/Name/@suppress = '0'">
       <xsl:call-template name="get.refentry.source.name">
         <xsl:with-param name="info" select="$info"/>
-        <xsl:with-param name="parentinfo" select="$parentinfo"/>
         <xsl:with-param name="prefs" select="$prefs/Name"/>
       </xsl:call-template>
     </xsl:if>
     <xsl:if test="$prefs/Version/@suppress = '0'">
       <xsl:call-template name="get.refentry.version">
         <xsl:with-param name="info" select="$info"/>
-        <xsl:with-param name="parentinfo" select="$parentinfo"/>
         <xsl:with-param name="prefs" select="$prefs/Version"/>
       </xsl:call-template>
     </xsl:if>
       <xsl:call-template name="evaluate.info.profile">
         <xsl:with-param name="profile" select="$prefs/@fallback"/>
         <xsl:with-param name="info" select="$info"/>
-        <xsl:with-param name="parentinfo" select="$parentinfo"/>
       </xsl:call-template>
     </xsl:when>
     <xsl:otherwise>
       <varlistentry>
         <term>info</term>
         <listitem>
-          <para>An info node (from a <tag>refentry</tag> element)</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>parentinfo</term>
-        <listitem>
-          <para>An info node (from a parent of a <tag>refentry</tag> element)</para>
+          <para>A set of info nodes (from a <tag>refentry</tag>
+          element and its ancestors)</para>
         </listitem>
       </varlistentry>
       <varlistentry>
 
 <xsl:template name="get.refentry.source.name">
   <xsl:param name="info"/>
-  <xsl:param name="parentinfo"/>
   <xsl:param name="prefs"/>
   <xsl:choose>
     <!-- * if profiling is enabled for source.name, and the -->
       <xsl:call-template name="evaluate.info.profile">
         <xsl:with-param name="profile" select="$prefs/@profile"/>
         <xsl:with-param name="info" select="$info"/>
-        <xsl:with-param name="parentinfo" select="$parentinfo"/>
       </xsl:call-template>
     </xsl:when>
     <xsl:otherwise>
           <xsl:message>Note: Missing class="source" data on refmeta/refmiscinfo</xsl:message>
           <xsl:choose>
             <!-- * no <refmisc class="source"/> found, so we need to -->
-            <!-- * check *info and parentinfo -->
-            <xsl:when test="$info/productname">
-              <xsl:apply-templates select="$info/productname/node()"/>
-            </xsl:when>
-            <xsl:when test="$info/orgname">
-              <xsl:apply-templates select="$info/orgname/node()"/>
-            </xsl:when>
-            <xsl:when test="$info/corpname">
-              <xsl:apply-templates select="$info/corpname/node()"/>
-            </xsl:when>
-            <xsl:when test="$info/corpcredit">
-              <xsl:apply-templates select="$info/corpcredit/node()"/>
-            </xsl:when>
-            <xsl:when test="$info/corpauthor">
-              <xsl:apply-templates select="$info/corpauthor/node()"/>
-            </xsl:when>
-            <xsl:when test="$info/author/orgname">
-              <xsl:apply-templates select="$info/author/orgname/node()"/>
-            </xsl:when>
-            <xsl:when test="$info/author/publishername">
-              <xsl:apply-templates select="$info/author/publishername/node()"/>
-            </xsl:when>
-            <!-- * then check parentinfo -->
-            <xsl:when test="$parentinfo/productname">
-              <xsl:apply-templates select="$parentinfo/productname/node()"/>
+            <!-- * check *info -->
+            <xsl:when test="$info//productname">
+              <xsl:apply-templates
+                  select="(($info[//productname])[last()]/productname)[1]"
+                  mode="get.refentry.metadata"/>
             </xsl:when>
-            <xsl:when test="$parentinfo/orgname">
-              <xsl:apply-templates select="$parentinfo/orgname/node()"/>
+            <xsl:when test="$info//orgname">
+              <xsl:apply-templates
+                  select="(($info[//orgname])[last()]/orgname)[1]"
+                  mode="get.refentry.metadata"/>
             </xsl:when>
-            <xsl:when test="$parentinfo/corpname">
-              <xsl:apply-templates select="$parentinfo/corpname/node()"/>
+            <xsl:when test="$info//corpname">
+              <xsl:apply-templates
+                  select="(($info[//corpname])[last()]/corpname)[1]"
+                  mode="get.refentry.metadata"/>
             </xsl:when>
-            <xsl:when test="$parentinfo/corpcredit">
-              <xsl:apply-templates select="$parentinfo/corpcredit/node()"/>
+            <xsl:when test="$info//corpcredit">
+              <xsl:apply-templates
+                  select="(($info[//corpcredit])[last()]/corpcredit)[1]"
+                  mode="get.refentry.metadata"/>
             </xsl:when>
-            <xsl:when test="$parentinfo/corpauthor">
-              <xsl:apply-templates select="$parentinfo/corpauthor/node()"/>
+            <xsl:when test="$info//corpauthor">
+              <xsl:apply-templates
+                  select="(($info[//corpauthor])[last()]/corpauthor)[1]"
+                  mode="get.refentry.metadata"/>
             </xsl:when>
-            <xsl:when test="$parentinfo/author/orgname">
-              <xsl:apply-templates select="$parentinfo/author/orgname/node()"/>
+            <xsl:when test="$info//author/orgname">
+              <xsl:apply-templates
+                  select="(($info[//author/orgname])[last()]/author/orgname)[1]"
+                  mode="get.refentry.metadata"/>
             </xsl:when>
-            <xsl:when test="$parentinfo/author/publishername">
-              <xsl:apply-templates select="$parentinfo/author/publishername/node()"/>
+            <xsl:when test="$info//author/publishername">
+              <xsl:apply-templates
+                  select="(($info[//author/publishername])[last()]/author/publishername)[1]"
+                  mode="get.refentry.metadata"/>
             </xsl:when>
             <xsl:otherwise>
               <xsl:message>Note: Missing "source name" metadata.</xsl:message>
       <varlistentry>
         <term>info</term>
         <listitem>
-          <para>An info node (from a <tag>refentry</tag> element)</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>parentinfo</term>
-        <listitem>
-          <para>An info node (from a parent of a <tag>refentry</tag> element)</para>
+          <para>A set of info nodes (from a <tag>refentry</tag>
+          element and its ancestors)</para>
         </listitem>
       </varlistentry>
       <varlistentry>
 
 <xsl:template name="get.refentry.version">
   <xsl:param name="info"/>
-  <xsl:param name="parentinfo"/>
   <xsl:param name="prefs"/>
   <xsl:choose>
     <!-- * if profiling is enabled for version, and the -->
       <xsl:call-template name="evaluate.info.profile">
         <xsl:with-param name="profile" select="$prefs/@profile"/>
         <xsl:with-param name="info" select="$info"/>
-        <xsl:with-param name="parentinfo" select="$parentinfo"/>
       </xsl:call-template>
     </xsl:when>
     <xsl:otherwise>
               select="refmeta/refmiscinfo[@class = 'version'][1]/node()"/>
         </xsl:when>
         <!-- * no <refmisc class="version"/> found, so we need to -->
-        <!-- * check *info and parentinfo -->
-        <xsl:when test="$info/productnumber">
-          <xsl:apply-templates select="$info/productnumber/node()"/>
-        </xsl:when>
-        <xsl:when test="$info/edition">
-          <xsl:apply-templates select="$info/edition/node()"/>
-        </xsl:when>
-        <xsl:when test="$info/releaseinfo">
-          <xsl:apply-templates select="$info/releaseinfo/node()"/>
+        <!-- * check *info -->
+        <xsl:when test="$info//productnumber">
+          <xsl:apply-templates
+              select="(($info[//productnumber])[last()]/productnumber)[1]"
+              mode="get.refentry.metadata"/>
         </xsl:when>
-        <!-- * then check parentinfo -->
-        <xsl:when test="$parentinfo/productnumber">
-          <xsl:apply-templates select="$parentinfo/productnumber/node()"/>
+        <xsl:when test="$info//edition">
+          <xsl:apply-templates
+              select="(($info[//edition])[last()]/edition)[1]"
+              mode="get.refentry.metadata"/>
         </xsl:when>
-        <xsl:when test="$parentinfo/edition">
-          <xsl:apply-templates select="$parentinfo/edition/node()"/>
-        </xsl:when>
-        <xsl:when test="$parentinfo/releaseinfo">
-          <xsl:apply-templates select="$parentinfo/releaseinfo/node()"/>
+        <xsl:when test="$info//releaseinfo">
+          <xsl:apply-templates
+              select="(($info[//releaseinfo])[last()]/releaseinfo)[1]"
+              mode="get.refentry.metadata"/>
         </xsl:when>
         <xsl:otherwise>
-          <!-- *found nothing, so return nothing -->
+          <!-- * found nothing, so return nothing -->
         </xsl:otherwise>
       </xsl:choose>
     </xsl:otherwise>
       <varlistentry>
         <term>info</term>
         <listitem>
-          <para>An info node (from a <tag>refentry</tag> element)</para>
-        </listitem>
-      </varlistentry>
-      <varlistentry>
-        <term>parentinfo</term>
-        <listitem>
-          <para>An info node (from a parent of a <tag>refentry</tag> element)</para>
+          <para>A set of info nodes (from a <tag>refentry</tag>
+          element and its ancestors)</para>
         </listitem>
       </varlistentry>
       <varlistentry>
 </doc:template>
 <xsl:template name="get.refentry.manual">
   <xsl:param name="info"/>
-  <xsl:param name="parentinfo"/>
   <xsl:param name="prefs"/>
   <xsl:variable name="Manual">
     <xsl:choose>
         <xsl:call-template name="evaluate.info.profile">
           <xsl:with-param name="profile" select="$prefs/@profile"/>
           <xsl:with-param name="info" select="$info"/>
-          <xsl:with-param name="parentinfo" select="$parentinfo"/>
         </xsl:call-template>
       </xsl:when>
       <xsl:otherwise>
                 select="refmeta/refmiscinfo[@class = 'manual'][1]/node()"/>
           </xsl:when>
           <!-- * no <refmisc class="manual"/> found, so we need to -->
-          <!-- * check title in parentinfo and parent title -->
-          <xsl:when test="$parentinfo/title">
-            <xsl:apply-templates select="$parentinfo/title/node()"/>
+          <!-- * check title in +info and parent title -->
+          <xsl:when test="$info//title">
+            <xsl:apply-templates
+                select="(($info[//title])[last()]/title)[1]"
+                mode="get.refentry.metadata"/>
           </xsl:when>
           <xsl:when test="../title">
-            <xsl:apply-templates select="../title/node()"/>
+            <xsl:apply-templates
+                select="../title/node()"
+                mode="get.refentry.metadata"/>
           </xsl:when>
           <xsl:otherwise>
             <!-- * found nothing, so return nothing -->
       <xsl:call-template name="evaluate.info.profile">
         <xsl:with-param name="profile" select="$prefs/@fallback"/>
         <xsl:with-param name="info" select="$info"/>
-        <xsl:with-param name="parentinfo" select="$parentinfo"/>
       </xsl:call-template>
     </xsl:when>
     <xsl:otherwise>
   </ManualPrefs>
 </xsl:template>
 
+<xsl:template match="date" mode="get.refentry.metadata">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="pubdate" mode="get.refentry.metadata">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="productname" mode="get.refentry.metadata">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="orgname" mode="get.refentry.metadata">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="corpname" mode="get.refentry.metadata">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="corpcredit" mode="get.refentry.metadata">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="corpauthor" mode="get.refentry.metadata">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="author/orgname" mode="get.refentry.metadata">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="author/publishername" mode="get.refentry.metadata">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="productnumber" mode="get.refentry.metadata">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="edition" mode="get.refentry.metadata">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="releaseinfo" mode="get.refentry.metadata">
+  <xsl:apply-templates/>
+</xsl:template>
+
+<xsl:template match="title" mode="get.refentry.metadata">
+  <xsl:apply-templates/>
+</xsl:template>
+
+
 </xsl:stylesheet>
index a3c99785e1e2f028359bc2007237e3404ae6f729..6c53c681f25782c3e6517dd9d804f39fe01f893a 100644 (file)
                           string-length(local-name()) - 3) = 'info']"
                   />
     <xsl:variable name="info" select="exsl:node-set($get.info)"/>
-    <!-- * Make a node-set with contents of parent's *info -->
-    <xsl:variable name="get.parentinfo"
-                  select="ancestor-or-self::*/*[substring(local-name(),
-                          string-length(local-name()) - 3) = 'info']"
-                  />
-    <xsl:variable name="parentinfo" select="exsl:node-set($get.parentinfo)"/>
 
     <!-- * The get.refentry.metadata template is in -->
     <!-- * ../common/refentry.xsl. It looks for metadata in $info -->
-    <!-- * and/or $parentinfo and in various other places and -->
-    <!-- * then puts it into a form that's easier for us to digest. -->
+    <!-- * and in various other places and then puts it into a form -->
+    <!-- * that's easier for us to digest. -->
     <xsl:variable name="get.refentry.metadata">
       <xsl:call-template name="get.refentry.metadata">
         <xsl:with-param name="refname" select="$first.refname"/>
         <xsl:with-param name="info" select="$info"/>
-        <xsl:with-param name="parentinfo" select="$parentinfo"/>
         <xsl:with-param name="prefs" select="$refentry.metadata.prefs"/>
       </xsl:call-template>
     </xsl:variable>
       <!-- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
       <xsl:call-template name="top.comment">
         <xsl:with-param name="info"       select="$info"/>
-        <xsl:with-param name="parentinfo" select="$parentinfo"/>
         <xsl:with-param name="date"       select="$refentry.metadata/date"/>
         <xsl:with-param name="title"      select="$refentry.metadata/title"/>
         <xsl:with-param name="manual"     select="$refentry.metadata/manual"/>
       <!-- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
       <xsl:call-template name="author.section">
         <xsl:with-param name="info" select="$info"/>
-        <xsl:with-param name="parentinfo" select="$parentinfo"/>
       </xsl:call-template>
       <!-- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -->
       <!-- * LINKS list (only if user wants links numbered and/or listed) -->
index f18ed267e7b41c527afc9f75e0c6f5b8e4940547..3f6357274d362e3b39d7e133b755828ccf2762ac 100644 (file)
@@ -59,7 +59,6 @@
 
   <xsl:template name="top.comment">
     <xsl:param name="info"/>
-    <xsl:param name="parentinfo"/>
     <xsl:param name="date"/>
     <xsl:param name="title"/>
     <xsl:param name="manual"/>
@@ -69,7 +68,7 @@
     <xsl:text>&#10;</xsl:text>
     <xsl:text>.\"    Author: </xsl:text>
       <xsl:call-template name="make.roff.metadata.author">
-        <xsl:with-param name="info" select="$parentinfo"/>
+        <xsl:with-param name="info" select="$info"/>
       </xsl:call-template>
     <xsl:text>&#10;</xsl:text>
     <xsl:text>.\" Generator: DocBook XSL Stylesheets v</xsl:text>
index d8c079629537fba1766152ca49f7684061c08f8e..7ce0d76a52a0b272b7fd067e389bf59bc9007781 100644 (file)
@@ -10,7 +10,7 @@
 
 <refsynopsisdiv>
 <src:fragment id='man.th.extra2.max.length.frag'>
-<xsl:param name="man.th.extra2.max.length">40</xsl:param>
+<xsl:param name="man.th.extra2.max.length">30</xsl:param>
 </src:fragment>
 </refsynopsisdiv>
 
@@ -29,9 +29,9 @@ data, often in the form
 for example, "GTK+ 1.2" (from the <literal>gtk-options(7)</literal>
 man page).</para>
 
-<para>The default value for this parameter is reasonable (perhaps too
-liberal) but somewhat arbitrary. If you are processing pages with long
-"source" infromation, you may want to experiment with changing the
-value in order to achieve the correct aesthetic results.</para>
+<para>The default value for this parameter is reasonable but somewhat
+arbitrary. If you are processing pages with long "source" information,
+you may want to experiment with changing the value in order to achieve
+the correct aesthetic results.</para>
 </refsect1>
 </refentry>
index 96acfcca0d844727b3c483ae2180518ac96525ae..ce51de15d2d46ef069b73d9fc956f9bc5ccbd51d 100644 (file)
 <refsynopsisdiv>
 <src:fragment id='refentry.date.profile.frag'>
 <xsl:param name="refentry.date.profile">
-  ($info/date
-  |$info/pubdate
-  |$parentinfo/date
-  |$parentinfo/pubdate)[1]/node()
+  (($info[//date])[last()]/date)[1]|
+  (($info[//pubdate])[last()]/pubdate)[1]
 </xsl:param>
 </src:fragment>
 </refsynopsisdiv>
index 33575f99ff97fece31b054b9fffcf9f6b57ca993..be058e5a1022298f7505e18d61b5e048dacbfbc1 100644 (file)
@@ -11,8 +11,8 @@
 <refsynopsisdiv>
 <src:fragment id='refentry.manual.profile.frag'>
 <xsl:param name="refentry.manual.profile">
-  ($parentinfo/title
-  |../title)[1]/node()
+  (($info[//title])[last()]/title)[1]|
+  ../title/node()
 </xsl:param>
 </src:fragment>
 </refsynopsisdiv>
index 8252210c08c34b53788e820cbacd9c0fcbfa6784..df6715c4c8b1e12934bb3c83ae0f0e09ca3d0f19 100644 (file)
 <refsynopsisdiv>
 <src:fragment id='refentry.source.name.profile.frag'>
 <xsl:param name="refentry.source.name.profile">
-  ($info/productname
-  |$parentinfo/productname
-  |$info/orgname
-  |$parentinfo/orgname
-  |$info/corpname
-  |$parentinfo/corpname
-  |$info/corpcredit
-  |$parentinfo/corpcredit
-  |$info/corpauthor
-  |$parentinfo/corpauthor
-  |$info/author/orgname
-  |$parentinfo/author/orgname
-  |$info//publishername
-  |$parentinfo//publishername)[1]/node()
+  (($info[//productname])[last()]/productname)[1]|
+  (($info[//orgname])[last()]/orgname)[1]|
+  (($info[//corpname])[last()]/corpname)[1]|
+  (($info[//corpcredit])[last()]/corpcredit)[1]|
+  (($info[//corpauthor])[last()]/corpauthor)[1]|
+  (($info[//author/orgname])[last()]/author/orgname)[1]|
+  (($info[//author/publishername])[last()]/author/publishername)[1]
 </xsl:param>
 </src:fragment>
 </refsynopsisdiv>
index b8e5a91a7bd95fc8510927d085f1f811e4e9a3bc..faef22a745fc64adee99db7e45e69eae113cbd5d 100644 (file)
 <refsynopsisdiv>
 <src:fragment id='refentry.version.profile.frag'>
 <xsl:param name="refentry.version.profile">
-  ($info/productnumber
-  |$parentinfo/productnumber
-  |$info/edition
-  |$parentinfo/edition
-  |$info/releaseinfo
-  |$parentinfo/releaseinfo)[1]/node()
+  (($info[//productnumber])[last()]/productnumber)[1]|
+  (($info[//edition])[last()]/edition)[1]|
+  (($info[//releaseinfo])[last()]/releaseinfo)[1]
 </xsl:param>
 </src:fragment>
 </refsynopsisdiv>