From: Bob Stayton Date: Tue, 23 Oct 2001 07:39:54 +0000 (+0000) Subject: Example files for olink toolkit. X-Git-Tag: release/1.79.1~6^2~6173 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=dd9bb4b6dbf3eb74add2047b88430f8e474313b1;p=docbook-dsssl Example files for olink toolkit. --- diff --git a/contrib/xsl-custom/newolink/examples/Makefile b/contrib/xsl-custom/newolink/examples/Makefile new file mode 100644 index 000000000..986224727 --- /dev/null +++ b/contrib/xsl-custom/newolink/examples/Makefile @@ -0,0 +1,66 @@ +# Makefile to demonstrate the use of +# newolink for linking between documents. + +# User guide and reference books + +UG-BASEURI = "../docroot/UserGuide/userguide.html" +INCL-BASEURI = "../docroot/Modular/" +REF-BASEURI = "../docroot/Reference" + + +ugtargets.xml : userguide.xml + xsltproc ../tools/targets.xsl userguide.xml > ugtargets.xml + +reftargets.xml : ref.xml + xsltproc ../tools/chunktargets.xsl ref.xml > reftargets.xml + +# Single-file output user guide + +$(UG-BASEURI) : userguide.xml reftargets.xml targetdb.xml ugtargets.xml + xsltproc --param target.database.document '"../docsrc/targetdb.xml"' \ + ../tools/custom.xsl userguide.xml > $(UG-BASEURI) 2> ug.err + +# Chunked output reference + +$(REF)/index.html : ref.xml ugtargets.xml targetdb.xml reftargets.xml + xsltproc --param target.database.document '"../docsrc/targetdb.xml"' \ + --output "../docroot/Reference/" \ + --param quiet 1 \ + ../tools/chunkcustom.xsl ref.xml 2> ref.err + +ug : $(UG-BASEURI) + +ref : $(REF)/index.html + +all: ug ref + +# Modular doc + +SRC = modular.xml preface.xml introduction.xml + +# Make the targets file +modtargets.xml : $(SRC) + xsltproc --xinclude \ + ../tools/chunktargets.xsl modular.xml > modtargets.xml + +# Process the whole book +modular: modtargets.xml + rm -f ../docroot/Modular/* + xsltproc --param target.database.document '"../docsrc/targetdb.xml"' \ + --xinclude \ + --output "../docroot/Modular/" \ + ../tools/chunkcustom.xsl modular.xml 2> mod.err + +# Process the preface only +preface : preface.xml + xsltproc --param target.database.document '"../docsrc/targetdb.xml"' \ + --xinclude \ + --output "../docroot/Modular/" \ + ../tools/chunkcustom.xsl preface.xml + +# Process the chapter only +intro : introduction.xml + xsltproc --param target.database.document '"../docsrc/targetdb.xml"' \ + --xinclude \ + --output "../docroot/Modular/" \ + ../tools/chunkcustom.xsl introduction.xml diff --git a/contrib/xsl-custom/newolink/examples/introduction.xml b/contrib/xsl-custom/newolink/examples/introduction.xml new file mode 100644 index 000000000..3d8842414 --- /dev/null +++ b/contrib/xsl-custom/newolink/examples/introduction.xml @@ -0,0 +1,15 @@ + + +]> + +Introduction to modular doc + +A paragraph in my chapter so far to see +how it will work when I form an olink to +. + + diff --git a/contrib/xsl-custom/newolink/examples/modular.xml b/contrib/xsl-custom/newolink/examples/modular.xml new file mode 100644 index 000000000..8145feca8 --- /dev/null +++ b/contrib/xsl-custom/newolink/examples/modular.xml @@ -0,0 +1,16 @@ + + +]> + + +Testing modular doc + + + + diff --git a/contrib/xsl-custom/newolink/examples/preface.xml b/contrib/xsl-custom/newolink/examples/preface.xml new file mode 100644 index 000000000..eaedb597c --- /dev/null +++ b/contrib/xsl-custom/newolink/examples/preface.xml @@ -0,0 +1,15 @@ + + +]> + +Preface in modular doc + +My only paragraph in my preface so far to see +how it will work when I form an olink to + + + diff --git a/contrib/xsl-custom/newolink/examples/ref.xml b/contrib/xsl-custom/newolink/examples/ref.xml new file mode 100644 index 000000000..49a07f4ca --- /dev/null +++ b/contrib/xsl-custom/newolink/examples/ref.xml @@ -0,0 +1,130 @@ + + +]> + + +Walsh +Norman +19992000 +Norman Walsh + + +HTML Parameter Reference + + +
Introduction + + +This is technical reference documentation for the DocBook XSL +Stylesheets; it documents (some of) the parameters, templates, and +other elements of the stylesheets. + +For general information on XSL architecture, see +. + + + +This reference describes each of the HTML Stylesheet parameters. +These are the easily customizable parts of the stylesheet. +If you want to specify an alternate value for one or more of these +parameters, you can do so in a driver stylesheet. + + + +For example, if you want to change the html.stylesheet +to reference.css, you might create a driver +stylesheet like this: + + +<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + version='1.0'> + + <xsl:import href="/path/to/html/docbook.xsl"/> + + <xsl:param name="html.stylesheet">reference.css</xsl:param> + +</xsl:stylesheet> + + +Naturally, you have to change the +href attribute on +<xsl:import> +to point to docbook.xsl +on your system. (Or chunk.xsl, if you're using +chunking.) + + + +This is not intended to be user documentation. +It is provided for developers writing customization layers for the +stylesheets, and for anyone who's interested in how it +works. + + + +Although I am trying to be thorough, this documentation is known +to be incomplete. Don't forget to read the source, too :-) + +
+
+ + + +author.othername.in.middle +Is othername in author a +middle name? + + + +<xsl:param name="author.othername.in.middle" select="1" doc:type="boolean"/> + +Description + +If true (non-zero), the othername of an author +appears between the firstname and +surname. Otherwise, othername +is suppressed. + + + + + + +html.stylesheet +Name of the stylesheet to use in the generated HTML + + + +<xsl:param name="html.stylesheet" select="''" doc:type="string"/> + +Description + +The name of the stylesheet to place in the HTML LINK +tag, or the empty string to suppress the stylesheet LINK. + + + + + + +html.stylesheet.type +The type of the stylesheet used in the generated HTML + + + +<xsl:param name="html.stylesheet.type" doc:type="string">text/css</xsl:param> + +Description + +The type of the stylesheet to place in the HTML link tag. + + + + +
diff --git a/contrib/xsl-custom/newolink/examples/targetdb.xml b/contrib/xsl-custom/newolink/examples/targetdb.xml new file mode 100644 index 000000000..c06dfcc69 --- /dev/null +++ b/contrib/xsl-custom/newolink/examples/targetdb.xml @@ -0,0 +1,22 @@ + + + + Information about this example + targets database + + + + diff --git a/contrib/xsl-custom/newolink/examples/ugtargets.xml b/contrib/xsl-custom/newolink/examples/ugtargets.xml new file mode 100644 index 000000000..860e63548 --- /dev/null +++ b/contrib/xsl-custom/newolink/examples/ugtargets.xml @@ -0,0 +1,52 @@ + + + Publishing DocBook Documents + ??? + + + A Survey of Stylesheet Languages + the section called “A Survey of Stylesheet Languages” + + + Stylesheet Examples + the section called “Stylesheet Examples” + + + FOSI stylesheet + the section called “FOSI stylesheet” + + + A Fragment of a FOSI Stylesheet + Example 1 + + + + DSSSL stylesheet + the section called “DSSSL stylesheet” + + + A Fragment of a DSSSL Stylesheet + Example 2 + + + + CSS stylesheet + the section called “CSS stylesheet” + + + A Fragment of a CSS Stylesheet + Example 3 + + + + XSL stylesheet + the section called “XSL stylesheet” + + + A Fragment of an XSL Stylesheet + Example 4 + + + + + diff --git a/contrib/xsl-custom/newolink/examples/userguide.xml b/contrib/xsl-custom/newolink/examples/userguide.xml new file mode 100644 index 000000000..a4e2b2a61 --- /dev/null +++ b/contrib/xsl-custom/newolink/examples/userguide.xml @@ -0,0 +1,176 @@ + + +]> +
+Publishing DocBook Documents + +Creating and editing SGML/XML documents is usually only half the +battle. After you've composed your document, you'll want to publish +it. Publishing, for our purposes, means either print or web +publishing. For SGML and XML documents, this is usually +accomplished with some kind of stylesheet. In +the (not too distant) future, you may be able to publish an XML +document on the Web by simply putting it online with a stylesheet, but +for now you'll probably have to translate your document into HTML. + + +Stylesheets provide the means for converting your documents +to HTML. You can use the stock stylesheets, or your can +customize them to meet your particular needs. +For example, if you have a CSS stylesheet you always want to be +used by your published HTML files, then you can set the + +html.stylesheet parameter in the XSL stylesheet +to the name of your CSS stylesheet. +You will also want to set the stylesheet type +using the + +parameter. + + +There are many ways, using both free and commercial tools, to publish +SGML documents. In this chapter, we're going to survey a number of +possibilities, and then look at just one solution in detail: Jade and the Modular DocBook +Stylesheets. We used jade to produce this +book and to produce the online versions on the +CD-ROM; it is also being deployed in other projects +such as <SGML>&tools;, +which originated with the Linux Documentation Project. + + +For a brief survey of other tools, see elsewhere. + +
A Survey of Stylesheet Languages + +Over the years, a number of attempts have been made to produce a +standard stylesheet language and, failing that, a large number of +proprietary languages have been developed. + + +FOSIs + + +First, the U.S. Department of Defense, in an attempt to +standardize stylesheets across military branches, created the +Output Specification, which is defined in +MIL-PRF-28001C, Markup Requirements and +Generic Style Specification for Electronic Printed Output and Exchange +of Text. + +See Formally +Published CALS Standards for more information. + + + + +Commonly called FOSIs (for Formatting Output Specification Instances), +they are supported by a few products including ADEPT Publisher by +Arbortext and DL +Composer by Datalogics. + + + +DSSSL + + +Next, the International Organization for Standardization +(ISO) created DSSSL, the +Document Style Semantics and Specification Language. Subsets of +DSSSL are supported by Jade and a few other tools, +but it never achieved widespread support. + + + +CSS + + +The W3C CSS Working Group created +CSS as a style attachment language for HTML, and, +more recently, XML. + + + +XSL + + +Most recently, the XML effort has identified a standard Extensible Style +Language (XSL) as a requirement. The +W3C XSL Working Group is +currently pursuing that effort. + + + + +
Stylesheet Examples + +By way of comparison, here's an example of each of the standard style +languages. In each case, the stylesheet fragment shown contains the +rules that reasonably formatted the following paragraph: + + +<para> +This is an example paragraph. It should be presented in a +reasonable body font. <emphasis>Emphasized</emphasis> words +should be printed in italics. A single level of +<emphasis>Nested <emphasis>emphasis</emphasis> should also +be supported.</emphasis> +</para> + +
+<acronym>FOSI</acronym> stylesheet + +FOSIs are SGML documents. The element in the +FOSI that controls the presentation of specific +elements is the e-i-c (element in context) element. +A sample FOSI fragment is shown in . + + +A Fragment of a <acronym>FOSI</acronym> Stylesheet + + +
+
<acronym>DSSSL</acronym> stylesheet + +DSSSL stylesheets are written in a Scheme-like +language (see “Scheme” later in this chapter). It is the +element function that controls the presentation of +individual elements. See the example in . + + +A Fragment of a <acronym>DSSSL</acronym> Stylesheet + + +
+
<acronym>CSS</acronym> stylesheet + +CSS stylesheets consist of selectors and formatting +properties, as shown in . + + +A Fragment of a <acronym>CSS</acronym> Stylesheet + + +
+
<acronym>XSL</acronym> stylesheet + +XSL stylesheets are XML documents, as shown in +. The element in the XSL +stylesheet that controls the presentation of specific elements is the +xsl:template element. + + +A Fragment of an <acronym>XSL</acronym> Stylesheet + + +
+
+
+