Karakas Online

7.1.5. DSSSL stylesheets

In Section 4.2 we copied these .dsl files to the current working directory:

Every change you wish to do should normally go in one of these three files - often even to more than one, e.g. when your change affects the HTML output for both one and many files (“chunks”). You should leave the original files that came with the Norman Walsh stylesheets unchanged and put your changes in the above files instead. Technically, this amounts to writing your own “driver” file. This is the easiest way to incorporate your preferences and remain flexible during upgrades.

Note TXT and HOWTO print targets
 

Currently, the lyxtox-print-txt.dsl and lyxtox-print-howto.dsl are not used, but are included here for your convenience and for the sake of completeness. You can thus see the common pattern used in all print stylesheets and use it for your own purposes.

For the TXT format I currently use the “onehtml” target: after the one, big HTML file has been rendered, Lynx (the text browser) is called with the -dump and -nolist options to create a text version directly from HTML, without any stylesheet for text. Note that, for a very complex document like the PHP-Nuke HOWTO (more than 500 pages, 1000 links to external URLs, 1500 cross-references, 2500 Index entries, 400 files in the “chunked” HTML version), the call to sgmltools with the “-b txt” option breaks with an error (caused probably by too many warnings about cross-references), although it works with smaller and less complex documents.

The “howto” print target is not used at all, but is included following the example of the print.dsl file that comes with the original sgmltools package.

The basic driver file looks like this (see Customizing the Stylesheets):

<!DOCTYPE style-sheet PUBLIC "-//James Clark//DTD DSSSL Style Sheet//EN" [
<!ENTITY dbstyle SYSTEM "docbook.dsl" CDATA DSSSL>
]>
<style-sheet>
<style-specification use="docbook">
<style-specification-body>
;; your stuff goes here...
</style-specification-body>
</style-specification>
<external-specification id="docbook" document="dbstyle">
</style-sheet>

Make sure that you specify, in the system identifier, the full path to the docbook.dsl file that you want to customize; for example, /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/print/docbook.dsl (this is already done in the stylesheets provided, at least as long as your other settings, like Catalogs (Section 4.5) are correct).

You can add your own definitions, or redefinitions, of stylesheet rules and parameters where

;; your stuff goes here...

occurs in the example above.

A lot of work, research and experimentation has been invested in the above three stylesheet files, so let's explain some of the most important changes they introduce:

Tip Important DocBook files
 

FYI, all changes presented here refer to variables that were originally defined in one of the following files:

  • /usr/share/sgml/stylesheets/sgmltools/print.dsl

  • /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/html/dbparam.dsl

  • /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/print/dbparam.dsl

  • /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/print/db31.dsl

  • /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/print/dbchunk.dsl

As said above, you should not change these files directly, because you will run into a lot of work when you upgrade them.

For a list of all parameters, with references to the files that use them, see the

  • /usr/share/sgml/docbook/docbook-dsssl-stylesheets-1.72/html/XREF

file. If you are looking for a parameter and you can't find the file it's in, the XREF file is your friend.

Last updated Mon Sep 24 01:19:25 CEST 2007 Permalink: http://www.karakas-online.de/mySGML/explain-dsssl-stylesheets.html All contents © 2002-2007 Chris Karakas