From bba4f927dbc1992b07b0c4cb9c97551f52ba62f5 Mon Sep 17 00:00:00 2001 From: Bob Stayton Date: Thu, 18 Jan 2007 06:27:36 +0000 Subject: [PATCH] Misc files needed to create docbook5ns-xsl from docbook-xsl. --- releasetools/db5files/README | 158 ++++++ releasetools/db5files/VERSION | 85 +++ releasetools/db5files/db5.xsl | 92 ++++ releasetools/db5files/manpages.table.xsl | 633 +++++++++++++++++++++++ 4 files changed, 968 insertions(+) create mode 100644 releasetools/db5files/README create mode 100644 releasetools/db5files/VERSION create mode 100644 releasetools/db5files/db5.xsl create mode 100644 releasetools/db5files/manpages.table.xsl diff --git a/releasetools/db5files/README b/releasetools/db5files/README new file mode 100644 index 000000000..59e8f05d6 --- /dev/null +++ b/releasetools/db5files/README @@ -0,0 +1,158 @@ +Candidate DocBook 5 XSL stylesheets +=========================================== +Bob Stayton +8 January 2007 + +This package contains a candidate release of XSL stylesheets +for processing DocBook 5 documents. The stylesheets are +the same as the snapshot stylesheet release of 2006-12-13 except that +the templates match on elements in the DocBook namespace. + +Note, the stylesheets in these directories have +not yet been converted to use the DocBook 5 namespace: + + slides + website + wordml + + +Background +------------- +DocBook 5 differs from preceding versions of DocBook because +its elements are in a namespace "http://docbook.org/ns/docbook". +Because the elements are in a namespace, the regular +DocBook XSL templates do not match on the elements. +In XSLT, a match attribute must explicitly specify +the namespace prefix to match an element in that namespace +(the default namespace does not apply to pattern matches). + +The regular stylesheets are able to process DocBook 5 +documents now, because they preprocess a DB5 document to +remove the namespace. When the regular stylesheet +detects that the root element is in the namespace, it +processes the document with mode="stripNS" to copy all +the nodes to a variable, but without the DocBook namespace. +Then it converts the variable to a nodeset, and processes +the nodeset with the regular templates. + +The alternative approach is to create a set of templates +that match on the native namespace of DocBook 5 documents. +These stylesheets do that. + +These stylesheets completely mimic the behavior of the +existing stylesheets. These are not XSLT 2.0 stylesheets, +and they do not have any other significant changes than handling +the namespaced elements. + +The two main advantages of these stylesheets are: + +a. You can write customization layers using the DocBook namespace. + +b. The xml:base of the root element is not lost during processing +(so things like images and the olink database can be found +more easily). + + +How these stylesheets were produced +---------------------------------------- +These stylesheets were created from a DocBook XSL +snapshot. Each xsl file was processed with a +Perl script and its output placed in a parallel +directory tree. Any non-xsl files were simply copied +into place. + +Perl was used because of its excellent regular expression +handling, and because Perl is able to preserve all whitespace. +This retains the pretty-printed format that makes +the stylesheets easier to read and understand. + +The stylesheet transforms each XSL match, select, test, +count, from, use, and elements attribute to add a "d:" +prefix to each element referenced in the attribute. +For example: + + + +becomes: + + + +In addition, each stylesheet file has a namespace declaration +added in its root element: + + + +You can process a DocBook 5 document with these stylesheets +using any XSLT processor, including xsltproc, Saxon 6 or 8, +and Xalan. Use these stylesheets as you would a stylesheet +from the regular distribution (except for slides, website, +and wordml). + +If you happen to process a DocBook document whose root element +is without the namespace declaration, the stylesheet +does not fail. Rather, it detects that the document +does not have the namespace, and preprocesses it to add the +namespace declaration to all elements in the document. +In a manner similar to stripNS, it copies the elements +to a variable while adding the namespace, converts the +variable to a nodeset, and then processes the nodeset with +the namespace-aware templates. + +If the stylesheet encounters an element from your file +for which the stylesheet has no matching template, +it reports the unmatched element. In these stylesheets, +it also reports the namespace URI that the element has. + + +Customizing these stylesheets +-------------------------------- +These stylesheets are customized with a customization +layer in the same manner as for the regular stylesheets, +with two differences. + +When you create a customization layer, you must do two things: + +a. Add the namespace declaration (with a prefix of your choice): + + + +Be sure to include the namespace prefix on all element +references, including those in match, select, and test +attributes, even when using an axis specifier. Here are +some examples: + + + + + + + +Failure to add the prefix to an element name will cause +the stylesheet to silently not match the intended element, +with consequences that are most likely undesirable. + + +Report any problems +------------------------ +These are experimental stylesheets and need thorough testing. +Please report any problems to bobs@sagehill.net. + diff --git a/releasetools/db5files/VERSION b/releasetools/db5files/VERSION new file mode 100644 index 000000000..e7f061181 --- /dev/null +++ b/releasetools/db5files/VERSION @@ -0,0 +1,85 @@ + + + + + + + + + DocBook + XSL Stylesheets + docbook5ns-snapshot-2007-01-08 + + + + + + Minor feature enhancements + + + + + + + http://sourceforge.net/projects/docbook/ + http://prdownloads.sourceforge.net/docbook/docbook-xsl-{VERSION}.tar.gz?download + http://prdownloads.sourceforge.net/docbook/docbook-xsl-{VERSION}.zip?download + http://prdownloads.sourceforge.net/docbook/docbook-xsl-{VERSION}.bz2?download + http://sourceforge.net/project/shownotes.php?release_id={SFRELID} + http://docbook.cvs.sourceforge.net/docbook/ + http://lists.oasis-open.org/archives/docbook-apps/ + This is a bug-fix release with a few feature enhancements. + + + + + + + You must specify the sf-relid as a parameter. + + + + + + + + + + + + + + + + + + : + + + + + + + + + : + + + + + + + + + : + + + + + diff --git a/releasetools/db5files/db5.xsl b/releasetools/db5files/db5.xsl new file mode 100644 index 000000000..bb025f4d1 --- /dev/null +++ b/releasetools/db5files/db5.xsl @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + WARNING: cannot add @xml:base to node + set root element. + Relative paths may not work. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + / + + + + + + + + diff --git a/releasetools/db5files/manpages.table.xsl b/releasetools/db5files/manpages.table.xsl new file mode 100644 index 000000000..d694e293c --- /dev/null +++ b/releasetools/db5files/manpages.table.xsl @@ -0,0 +1,633 @@ + + + + + + + : + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + allbox + + + + + + + + center + + + + + + + + expand + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + + + + + +
+
+ + + + + + + + + + + + + + + + + + .PP + . + + + + *[nested table] + + + + .sp -1n + + + + + .TS + + + H + + + + + + + + + + + tab( + + ) + + + + ; + + + + + + + + + + + + + + + + .TH + + + + + + + + + + + .T& + + + + + + + + + + + + + + + + + + + + + + .TE + + .sp + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + T{ + + T} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Warn + + + tbl convert : Extracted a nested table + + + [\fInested table\fR]* + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + . + + + + + + + + + + + + + + + + + + + + + + + ^ + + + c + + + r + + + n + + + + l + + + + + + + + t + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ^ + + + + s + + + + + + + + + + + + + + + + + + + + + + + + + + + + + .br + + + + + + + + + ftn. + + + + + + # + + + + + + [ + + ] + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
-- 2.49.0