[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Howto make HTML from Docbook-XML?



On , September 4, Michael Alan Dorman wrote:
> debacle@knorke.in-berlin.de (W. Borgert) writes:

> DSSSL is not "outdated", but I find that these days using XSL seems to
> require less intimate knowledge of the tools, making it the path of
> least resistance.

I agree with Mike - unless you're very scheme/lisp oriented, xsl
stylesheets are much easier to work with.

> I don't think the printed materials look as nice yet---I'm thinking of
> the PDFs you get running stuff through Fop---but if PassiveTeX ever
> gets packaged, it will probably get even harder to justify using
> anything else, as I've heard its output rivals anything JadeTeX was
> able to do.

Sebastian Rahtz & I are going to start working on passivetex packaging
today (hopefully) - he's been out of town. I should be able to upload
it by the end of the week.

> > The stylesheets seem to produce always one large HTML file from a
> > book or article, while I would prefer the way db2html handles it.
> > Is there a trick, how to do this?
>
I'm not sure that xsltproc supports chunking, yet. Saxon and Xalan2
seem to work fine with chunk.xsl. XT does, as well, but you must use
the xtchunk.xsl stylesheet.

I've written some wrappers for XT and Saxon which provide catalog
support and a friendlier user interface. I'll try to get them uploaded
tonight with a bunch of other updates.

> If you read through the documentation closely---I think I found it on
> nwalsh.com, but I'm not sure, maybe it was in /usr/share/doc---you'll
> find references to xtchunk.xsl, which will do what you want---and
> despite the fact that the docs make it sound like it's XT specific,
> xsltproc seems to chew on it just fine.
> 
> For my documents, I use a customization template like the following:
> 
> <?xml version='1.0'?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version='1.0' xmlns="http://www.w3.org/TR/xhtml1/transitional"; exclude-result-prefixes="#default">
>   <xsl:import href="/usr/share/sgml/docbook/stylesheet/xsl/nwalsh/html/xtchunk.xsl"/>
>   <xsl:variable name="html.stylesheet">guide.css</xsl:variable>
>   <xsl:variable name="toc.section.depth">2</xsl:variable>
>   <xsl:variable name="section.autolabel">1</xsl:variable>
>   <xsl:variable name="generate.division.toc">0</xsl:variable>
>   <xsl:variable name="toc.list.type">ul</xsl:variable>
>   <xsl:variable name="use.extensions">1</xsl:variable>
>   <xsl:variable name="use.id.as.filename">ul</xsl:variable>
> </xsl:stylesheet>
> 
> I put this in a file named guide.xsl, and I invoke xsltproc as:
> 
> xsltproc guide.xml guide.xsl
> 
> And it produces multiple files.  When I go through and finish IDing
> all my articles/sections, it'll even name them they way I want. :-)
 
Guess I was wrong about xsltproc & chunking.  

> > If I have to use XSL, which XSLT processor in Debian is suitable for
> > the docbook-xsl-stylesheets?  I tried xsltproc, which worked fine,
> > but maybe another is better/faster/ whatever?
> 
> I like xsltproc---it's seems fast, at least since 0.13 or so it seems
> pretty darn complete, etc.
> 
> I have considered playing with saxon because it has the ability to do
> includes in a way that I gather doesn't require pre-processing them to
> escape entities, and since some of my documentation could benefit from
> that, it's tempting.  

More later on this stuff. 

Mark

> But it's *almost* as easy to have make just
> preprocess them---I use the following make rule and snippet of perl to
> encode them:
> 
> %.xml : %; perl -MHTML::Entities -pe 'encode_entities ($$_)' $< > $@
> 
> Mike.
> -- 
> "One does not write satire anymore; one merely tries to stay half a
> step ahead of reality." -- Jon Carroll
> 
> 
> -- 
> To UNSUBSCRIBE, email to debian-sgml-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

-- 
_____________________________________
Mark Johnson
Duke Physics        <mark@duke.edu>
Debian SGML         <mrj@debian.org>
Home Page:          <http://dulug.duke.edu/~mark/>
GPG fp: 50DF A22D 5119 3485 E9E4  89B2 BCBC B2C8 2BE2 FE81



Reply to: