This is the mail archive of the docbook-apps@lists.oasis-open.org mailing list .


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: cocoon and norms xsl-sheets


I have used Cocoon on Linux with Norm's stylesheets,
but Cocoon is more than you need.  Cocoon provides
the servlet services of processing XML within an Apache
server, and it is a bit tricky to set up.
But you can do the same thing outside of Apache.

In this case, you need to use an XSLT processor with Norm's
stylesheets to generate the flow object file, and then you
need a flow object processor to convert that to PDF which
you can print.

You'll need:

1. Java installed (I'm running 1.1.8)

2. xt.jar, xp.jar, and sax.jar from James Clark's website www.jclark.com
in the XT and XP distributions.

3. fop.jar from the FOP project at xml.apache.org.

Put these jar files with your other Java classes and
add them to your classpath.  Here is the script
that I use, you'll have to adjust the paths to
your system:

#----------------------snip---------------------------
#!/bin/sh

# xml2pdf - convert Docbook XML file into PDF file
# Usage:   xml2pdf filename.xml

# Produces a filename.fo and filename.pdf file.
# Uses apache fop.

# Set some env variables
JAVABIN=/usr/java/bin
JAVALIB=/usr/java/lib
STYLESHEET=$HOME/stylesheets/docbook/fo/docbook.xsl
JC=$HOME/javaclasses
export JAVABIN JAVALIB SCODOC JC
CLASSPATH=$JAVALIB/classes.zip:$JC/xt.jar:$JC/xp.jar:$JC/sax.jar:$JC/fop.jar
export CLASSPATH

# Convert from xml to formatting object tree file using XT:

BASE=`basename $1 .xml`
$JAVABIN/java com.jclark.xsl.sax.Driver $1 $STYLESHEET > $BASE.fo

# Convert the fo tree to pdf using apache FOP:

$JAVABIN/java org.apache.fop.apps.CommandLine $BASE.fo $BASE.pdf

#EOF
#----------------------snip---------------------------

I have not actually used the PDF output from this
process very much yet, and can't vouch for the quality.
It is possible that the jade/DSSSL route, which is more
mature, will produce better results.

But you can do this in less that 24 hours.
Hope you have longer deadlines the next time you
need to use cutting edge technology!
Good luck.

bobs
Bob Stayton                                 400 Encinal Street
Publications Architect                      Santa Cruz, CA  95060
Technical Publications                      voice: (831) 427-7796
The Santa Cruz Operation, Inc.              fax:   (831) 429-1887
                                            email: bobs@sco.com

> From: Inge <telmin@ol.telia.no>
> 
> Hello again.
> Another question.. print is king.
> 
> Have any of you used cocoon (the version i may use is 1.7.3) successfully with Norm's newest xsl? Not me...
> 
> I am worried.. Within less than 24 hours i must have managed to output this document to a good printable. I guess emacs-pretty-print-buffer doesn't qualify..
> 	(Yes, no, i am not ahead of time much..)
> 
> Cocoon i have access to, but not much experience with.. neither am i particularily skilled as an xsl(t) hacker. It is supposedly able, but..am i? : 
> so.. Cocoon cares:
> 1:
> For html? -i should think this would be clean tweakless deal (?)
> 2:
> For creating fot? -in this respect i am optimisticic!
> only what will i manage to do with it.. 
>  Are there any tools i should consider to install for this, like a readymade something, e.g. -"fo2rtf","fot2pdf", or similar,  in lunix naming terms..? 
> 3:
> For creating rtf/pdf/latex/tex/dvi/ps/any-decent-printable-format? -almost pessimistic here..
> Any particular concerns? 
> 
> inge
> 
> --
> teLmin@oL.teLia.no <<<java<is<not<my>cup>of>tea>>>

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]