docbook: DocBook XML -> HTML, XHTML via XSL


Previous by date: 21 May 2001 02:40:08 -0000 Re: How do I convert sgml to text format in RH7.1, T.J. Yang
Next by date: 21 May 2001 02:40:08 -0000 DocBook XML & Norm's XSL stylesheets cont., Dan Scott
Previous in thread:
Next in thread:

Subject: DocBook XML -> HTML, XHTML via XSL
From: Dan Scott ####@####.####
Date: 21 May 2001 02:40:08 -0000
Message-Id: <Pine.LNX.4.30.0105201141400.1114-100000@denials.dyn.dhs.org>

Just wanted to report that I've been using the following combination to
convert my DocBook XML documents to HTML (and XHTML, just for fun) for the
last couple of weeks, and I think it's a pretty solid approach that we
might want to add to the LAG; the setup seems a *lot* simpler than most of
the SGML-based transforms that we document.

Roughly:

Converting DocBook XML to HTML with Norm Walsh's XSL stylesheets:

Prerequisites:

Some sort of XSLT processor (my setup uses the IBM JDK 1.3.0 plus the
Xalan-J2 XSLT processor engine)

Norm Walsh's DocBook XSL stylesheets from
https://sourceforge.net/project/showfiles.php?group_id=21935 (I use the
experimental version 1.37)

Running the transform:

export JAVA_HOME=/opt/IBMJava2-13
export XALAN_HOME=/opt/xalan-j_2_0_1
export DOCBOOK_XSL=/opt/docbook-xsl-1.37

$JAVA_HOME/jre/bin/java -cp $XALAN_HOME/bin/xalan.jar \
org.apache.xalan.xslt.Process -IN document.xml -OUT document.html \
-XSL $DOCBOOK_XSL/html/docbook.xsl

The setup is pretty easy, the transform validates your XML, and the
output is very clean. Haven't tried running the resulting HTML through
HTMLDOC yet, though.

As part of the stylesheet package, Norm does ship some FO stylesheets
for producing PDF directly from the XML, but they don't produce very
usable output at the moment.

Note: If you do want to produce XHTML instead of HTML, you can't just
specify the $DOCBOOK_XSL/xhtml/docbook.xsl stylesheet; you also have to
alter the $DOCBOOK_XSL/html/docbook.xsl stylesheet to specify xsl:output
method="xml" instead of method="html", because the xhtml stylesheet
includes the html stylesheet.

So, when do we start requiring authors to submit their documents in
DocBook XML? :) I am TOTALLY kidding!


-- 
Dan Scott


Previous by date: 21 May 2001 02:40:08 -0000 Re: How do I convert sgml to text format in RH7.1, T.J. Yang
Next by date: 21 May 2001 02:40:08 -0000 DocBook XML & Norm's XSL stylesheets cont., Dan Scott
Previous in thread:
Next in thread:


  ©The Linux Documentation Project, 2014. Listserver maintained by dr Serge Victor on ibiblio.org servers. See current spam statz.