From: Michael Smith Date: Fri, 7 Apr 2006 12:21:25 +0000 (+0000) Subject: Drastically reworked all of the XPath expressions used in refentry X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ed08222afc9491c05f199b2be5b1e0aa1a280ff2;p=docbook-dsssl Drastically reworked all of the XPath expressions used in refentry 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. --- diff --git a/xsl/common/common.xsl b/xsl/common/common.xsl index 7260592a9..6b86769e5 100644 --- a/xsl/common/common.xsl +++ b/xsl/common/common.xsl @@ -1944,13 +1944,13 @@ unchanged. extension function. The value of the profile parameter - can include the strings $info and - $parentinfo. If found in the value of the - profile parameter, those strings are - evaluated using the info and - parentinfo parameters, the values of which - should be DocBook *info element node - sets. + can include the literal string $info. If found + in the value of the profile parameter, the + literal string $info string is replaced with + the value of the info parameter, which + should be a set of *info nodes; the + expression is then evaluated using the XSLT + evaluate() extension function. @@ -1963,13 +1963,7 @@ unchanged. info - A DocBook info node - - - - parentinfo - - A DocBook info node (from a parent element) + A set of *info nodes @@ -1984,17 +1978,16 @@ unchanged. - - + + select="dyn:evaluate($profile)" mode="get.refentry.metadata"/> - + + select="saxon:evaluate($profile)" mode="get.refentry.metadata"/> diff --git a/xsl/common/refentry.xsl b/xsl/common/refentry.xsl index 987121aac..7301eb8e0 100644 --- a/xsl/common/refentry.xsl +++ b/xsl/common/refentry.xsl @@ -52,7 +52,7 @@ - Gathers metadata from a refentry and its parent + Gathers metadata from a refentry and its ancestors Reference documentation for particular commands, functions, @@ -62,10 +62,11 @@ embed "context" information in output for each refentry. 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 refentry 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 + refentry itself, but instead part of the content of a + parent or ancestor element to the the refentry. 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 productnumber element to mark up version information about a particular product, while another might use @@ -73,16 +74,22 @@ Taking all that in mind, the get.refentry.info function tries to gather - metadata from a refentry element and its parent element - in an intelligent and user-configurable way. + metadata from a refentry 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 refentry â€“ either on the + refentry itself, or on its nearest ancestor. - The get.refentry.info 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. + The get.refentry.info 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. - The manpages stylesheets are an application of these APIs. + The manpages stylesheets are an application of the “APIs” in + this stylesheet. @@ -96,14 +103,8 @@ info - An info node (from a refentry element) - - - - parentinfo - - An info node (from a parent of a refentry - element) + A set of info nodes (from a refentry + element and its ancestors) @@ -161,7 +162,6 @@ - <xsl:call-template name="get.refentry.title"> @@ -174,21 +174,18 @@ <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> @@ -294,13 +291,8 @@ <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> @@ -317,7 +309,6 @@ <xsl:template name="get.refentry.date"> <xsl:param name="info"/> - <xsl:param name="parentinfo"/> <xsl:param name="prefs"/> <xsl:variable name="Date"> <xsl:choose> @@ -328,42 +319,28 @@ <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> @@ -463,13 +440,8 @@ <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> @@ -487,13 +459,11 @@ <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> @@ -502,7 +472,6 @@ <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> @@ -528,7 +497,6 @@ <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> @@ -554,13 +522,8 @@ <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> @@ -580,7 +543,6 @@ <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 --> @@ -591,7 +553,6 @@ <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> @@ -607,49 +568,41 @@ <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> @@ -678,13 +631,8 @@ <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> @@ -704,7 +652,6 @@ <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 --> @@ -715,7 +662,6 @@ <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> @@ -728,28 +674,24 @@ 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> @@ -803,13 +745,8 @@ <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> @@ -826,7 +763,6 @@ </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> @@ -838,7 +774,6 @@ <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> @@ -851,12 +786,16 @@ 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 --> @@ -875,7 +814,6 @@ <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> @@ -960,4 +898,57 @@ </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> diff --git a/xsl/manpages/docbook.xsl b/xsl/manpages/docbook.xsl index a3c99785e..6c53c681f 100644 --- a/xsl/manpages/docbook.xsl +++ b/xsl/manpages/docbook.xsl @@ -155,22 +155,15 @@ 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> @@ -184,7 +177,6 @@ <!-- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <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"/> @@ -227,7 +219,6 @@ <!-- * - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - --> <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) --> diff --git a/xsl/manpages/other.xsl b/xsl/manpages/other.xsl index f18ed267e..3f6357274 100644 --- a/xsl/manpages/other.xsl +++ b/xsl/manpages/other.xsl @@ -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> </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> </xsl:text> <xsl:text>.\" Generator: DocBook XSL Stylesheets v</xsl:text> diff --git a/xsl/params/man.th.extra2.max.length.xml b/xsl/params/man.th.extra2.max.length.xml index d8c079629..7ce0d76a5 100644 --- a/xsl/params/man.th.extra2.max.length.xml +++ b/xsl/params/man.th.extra2.max.length.xml @@ -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> diff --git a/xsl/params/refentry.date.profile.xml b/xsl/params/refentry.date.profile.xml index 96acfcca0..ce51de15d 100644 --- a/xsl/params/refentry.date.profile.xml +++ b/xsl/params/refentry.date.profile.xml @@ -11,10 +11,8 @@ <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> diff --git a/xsl/params/refentry.manual.profile.xml b/xsl/params/refentry.manual.profile.xml index 33575f99f..be058e5a1 100644 --- a/xsl/params/refentry.manual.profile.xml +++ b/xsl/params/refentry.manual.profile.xml @@ -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> diff --git a/xsl/params/refentry.source.name.profile.xml b/xsl/params/refentry.source.name.profile.xml index 8252210c0..df6715c4c 100644 --- a/xsl/params/refentry.source.name.profile.xml +++ b/xsl/params/refentry.source.name.profile.xml @@ -11,20 +11,13 @@ <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> diff --git a/xsl/params/refentry.version.profile.xml b/xsl/params/refentry.version.profile.xml index b8e5a91a7..faef22a74 100644 --- a/xsl/params/refentry.version.profile.xml +++ b/xsl/params/refentry.version.profile.xml @@ -11,12 +11,9 @@ <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>