[Refdb-users] Using xsl customisation layer with refdb
Status: Beta
Brought to you by:
mhoenicka
|
From: David N. <dav...@bi...> - 2004-03-02 14:06:26
|
After some help from Markus I have managed to implement an xsl
customisation layer with refdb.
Here's how in case there are any other newbies wondering.
I use DocBook XML on a Debian Sarge/testing box.
First, the theory:
Usually, at configure time the --with-docbook-xsl option is set to point
at the root directory of the original ("Norman Walsh") docbook
stylesheets. On my box that is:
/usr/share/sgml/docbook/stylesheet/xsl/nwalsh.
The refdb install sets the refdb stylesheets to import those original
docbook stylesheets.
So, when you create a document and type in "make html|pdf|whatever", the
makefile creates a stylesheet in the document directory --> it calls the
refdb stylesheets --> which call the original docbook stylesheets.
What we are going to do is create an extra link in that chain: the
makefile will create a stylesheet in the document directory --> it
calls the refdb stylesheets --> which call our customisation layer
stylesheets --> which call the original docbook stylesheets.
Now, the practice:
The first thing to do is create the customisation layer. You must
create the following directory/file structure in a directory of your choice:
BASE_DIR/fo
BASE_DIR/fo/docbook.xsl
BASE_DIR/html
BASE_DIR/html/docbook.xsl
BASE_DIR/xhtml
BASE_DIR/xhtml/docbook.xsl
Each docbook.xsl file must include an appropriate import statement
importing the matching original docbook stylesheet.
Here is my fo/docbook.xsl file:
----------------------------------------------------------------------------------------
<!--
FO customisation layer for refdb stylesheets
First imports original DocBook stylesheets
Finally imports my custom stylesheets
-->
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"
xmlns:fo="http://www.w3.org/1999/XSL/Format">
<!-- the original docbook stylesheets for FO -->
<xsl:import
href="/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/fo/docbook.xsl"/>
<!-- my customisation layer -->
<xsl:import
href="/home/david/data/conf/xsl/custom-layer/fo-custom.xsl"/>
</xsl:stylesheet>
----------------------------------------------------------------------------------------
You must include a file called VERSION in the base directory of your
customisation layer. It is to keep the configure test happy. The file
can be empty. I created mine using the command: touch VERSION.
Now you are ready to install (or re-install) refdb with the proper
configuration. At the ./configure step you must use the
--with-docbook-xsl option and specify the full path to your
customisation layer base directory.
On my box, that option looked like:
--with-docbook-xsl=/home/david/data/conf/refdb/xsl
Hope that helps,
David.
|