From 8a17559be225a6b500b20006c26ed283af753a9b Mon Sep 17 00:00:00 2001 From: Michael Smith Date: Thu, 13 Apr 2006 23:30:16 +0000 Subject: [PATCH] Refined XPath statements and notification messages for refentry metadata handling. --- xsl/common/common.xsl | 6 +- xsl/common/refentry.xsl | 313 ++++++++++++++++++++++++++------------- xsl/manpages/docbook.xsl | 8 +- xsl/manpages/other.xsl | 94 +++++++++++- 4 files changed, 307 insertions(+), 114 deletions(-) diff --git a/xsl/common/common.xsl b/xsl/common/common.xsl index 6b86769e5..6ce995b55 100644 --- a/xsl/common/common.xsl +++ b/xsl/common/common.xsl @@ -1,10 +1,9 @@ diff --git a/xsl/common/refentry.xsl b/xsl/common/refentry.xsl index 416c875e3..70d71f033 100644 --- a/xsl/common/refentry.xsl +++ b/xsl/common/refentry.xsl @@ -17,7 +17,7 @@ - + @@ -90,8 +90,6 @@ data as a set. - The manpages stylesheets are an application of the “APIs” in - this stylesheet. @@ -171,32 +169,31 @@
- + + +
+ + + - - Note - To suppress "meta" messages, set $refentry.emit.messages to 0. - @@ -260,6 +257,12 @@ + + refname + + The first refname in the refentry + + quiet @@ -282,9 +285,10 @@ Note + meta manvolnum: No manvolnum. + >meta manvol : No manvolnum @@ -292,9 +296,10 @@ Note + meta manvolnum: Found funcsynopsis. Setting man section to 3. + >meta manvol : Setting man section to 3 3 @@ -320,6 +325,12 @@ + + refname + + The first refname in the refentry + + info @@ -359,20 +370,11 @@ - - - - - - date - - + + @@ -390,9 +392,10 @@ Note + meta "date" : No date found. Generating localized date. + >meta date : No date. Using generated date @@ -485,6 +488,12 @@ + + refname + + The first refname in the refentry + + info @@ -512,6 +521,7 @@ + @@ -520,6 +530,7 @@ + @@ -555,9 +566,10 @@ Warn + meta "source" : No valid fallback found. Leaving empty. + >meta source : No valid fallback. Leaving empty @@ -565,9 +577,10 @@ Warn + meta "source" : No fallback specified; leaving empty. + >meta source : No fallback specified; leaving empty. @@ -587,6 +600,12 @@ + + refname + + The first refname in the refentry + + info @@ -632,59 +651,61 @@ select="refmeta/refmiscinfo[@class = 'source' or @class='software'][1]/node()"/> - - Note - meta "source" : No refmiscinfo@class="source"|"software" - - + + + select="($info[productname])[last()]"/> + select="(($info[productname])[last()]/productname)[1]"/> source - + + + select="($info[corpname])[last()]"/> + select="(($info[corpname])[last()]/corpname)[1]"/> source + productname - + + + select="($info[corpcredit])[last()]"/> + select="(($info[corpcredit])[last()]/corpcredit)[1]"/> source + productname - + + + select="($info[corpauthor])[last()]"/> + select="(($info[corpauthor])[last()]/corpauthor)[1]"/> source + productname + @@ -692,10 +713,12 @@ name="contents" select="(($info[//orgname])[last()]//orgname)[1]"/> source + productname + @@ -703,14 +726,23 @@ name="contents" select="(($info[//publishername])[last()]//publishername)[1]"/> source + productname Note + + meta source : No productname or alternative + + + Note + meta "source" : No valid alternatives to refmiscinfo. + >meta source : No refmiscinfo@class=source @@ -734,6 +766,12 @@ + + refname + + The first refname in the refentry + + info @@ -779,52 +817,59 @@ select="refmeta/refmiscinfo[@class = 'version'][1]/node()"/> - - Note - meta "version": No refmiscinfo@class="version" - - + + + select="($info[productnumber])[last()]"/> + select="(($info[productnumber])[last()]/productnumber)[1]"/> version - + + + select="($info[edition])[last()]"/> + select="(($info[edition])[last()]/edition)[1]"/> version + productnumber - + + + select="($info[releaseinfo])[last()]"/> + select="(($info[releaseinfo])[last()]/releaseinfo)[1]"/> version + productnumber Note + meta "version": No valid alternatives to refmiscinfo. + >meta version: No productnumber or alternative + + + Note + + meta version: No refmiscinfo@class=version @@ -889,6 +934,12 @@ + + refname + + The first refname in the refentry + + info @@ -929,41 +980,49 @@ select="refmeta/refmiscinfo[@class = 'manual' or @class = 'sectdesc'][1]/node()"/> - - Note - meta "manual" : No refmiscinfo@class="manual"|"sectdesc" - + + + + - + + + select="(ancestor::*[title])[1]"/> + select="(ancestor::*[title])[1]/title"/> manual - + + + select="($info[title])[1]"/> + select="(($info[title])[1]/title)[1]"/> manual Note + meta "manual" : No valid alternatives to refmiscinfo. + >meta manual : No ancestor with title + + + Note + + meta manual : No refmiscinfo@class=manual @@ -976,8 +1035,7 @@ - - + @@ -992,9 +1050,10 @@ Warn + meta "manual" : No valid fallback found. Leaving empty. + >meta manual : No valid fallback. Leaving empty @@ -1003,9 +1062,10 @@ Warn + meta "manual" : No fallback specified; leaving empty. + >meta manual : No fallback specified; leaving empty. @@ -1095,12 +1155,17 @@ The set.refentry.metadata function is called each time a suitable source element is found for a certain - metadata field. It emits a message indicating what source element - it has found. + metadata field. + + refname + + The first refname in the refentry + + info @@ -1128,24 +1193,58 @@
+ - - Note - meta "" - - - : Using / - + + + + Note + + meta + + + : No + + + Note + + meta + + + : No refmiscinfo@class= + + + Note + + meta + + + : Using + + @@ -1170,6 +1269,12 @@ Warning) + + refname + + The first refname in the refentry + + message @@ -1184,11 +1289,19 @@ + - + : + select="$message"/> + + + diff --git a/xsl/manpages/docbook.xsl b/xsl/manpages/docbook.xsl index 7a6318a81..755e8f01d 100644 --- a/xsl/manpages/docbook.xsl +++ b/xsl/manpages/docbook.xsl @@ -3,17 +3,15 @@ xmlns:exsl="http://exslt.org/common" xmlns:ng="http://docbook.org/docbook-ng" xmlns:db="http://docbook.org/ns/docbook" - exclude-result-prefixes="db ng exsl" + exclude-result-prefixes="exsl" version='1.0'> - - diff --git a/xsl/manpages/other.xsl b/xsl/manpages/other.xsl index a8798876e..927993bf1 100644 --- a/xsl/manpages/other.xsl +++ b/xsl/manpages/other.xsl @@ -1,6 +1,7 @@ @@ -29,6 +30,91 @@ + + + + + + @@ -282,8 +368,11 @@ + - Note: + Note: @@ -369,13 +458,14 @@ - + Note: (manifest file) + -- 2.40.0