OASIS Mailing List ArchivesView the OASIS mailing list archive below
or browse/search using MarkMail.


Help: OASIS Mailing Lists Help | MarkMail Help

docbook-apps message

[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]

Subject: Re: [docbook-apps] Java and docbook xsl again

attached is the example, coupl of notes;-

the first part configures the paths for the classpaths, it needs to 
match your system

then i've used properties for input/output paths to make things easier

this stuff tends to go in a separate "init" target that can be depended upon

i note that your attempting to process a directory full of files, this 
exmaple only does a single file

however saxon will except a dir for in and out params , however you 
can't filter out files like "empty.xml" - this is what I meant by a 
downside of the java task - it doesn't do stuff that style/xslt does for 
you. you would have to eddit the fop task for multiple files as well.

oh one other detail, i use forward slashes on all paths - ant usually 
tranlates these for you. this *isn't* done for things passed as 
arguments to the java task.

with some hacking this should meet your needs...



Wendy Smoak wrote:
> [sorry, wrong button before...]
> From: "Ian Atkin" <ianatkin@blueyonder.co.uk>
>> I have a working example build script with ant 1.6.2, saxon 6.5.3, 
>> docbook-xsl 1.68.1 and fop 0.20.5 if your interested...
> What I was trying to say is, Yes!  An example build file would be great. 
> I've got the 'fop' task working for .fo -> .pdf, but the only way I can 
> get the .fo file is with Cygwin and 'xmlto'.
> Thanks,
> Wendy Smoak
<?xml version="1.0"?>
<project name="saxon-dbk-pdf" default="build" basedir=".">

  <target name="build">
    <!-- ================ CONFIG =================== -->
    <!-- software paths, adjust for your system -->
    <property name="dbk.xsl.dir" 
    <property name="fop.dir" 
    <property name="saxon.dir" 
    <property name="resolver.dir" 
    <!-- in/out paths, edit for your needs -->
    <property name="input.xml.path" 
    <property name="output.fo.path" 
    <property name="output.pdf.path" 
    <!-- classpaths, shouldn't need to change (unless software distribution has changed locations-->
    <taskdef name="fop" 
        <pathelement location="${fop.dir}/build/fop.jar"/>
        <pathelement location="${fop.dir}/build/fop.jar"/>
        <pathelement location="${fop.dir}/lib/avalon-framework-cvs-20020806.jar"/>
        <pathelement location="${fop.dir}/lib/batik.jar"/>
    <path id="classpath">
        <pathelement location="${saxon.dir}/saxon.jar"/>  
        <pathelement location="${resolver.dir}/resolver.jar"/>      
    <!-- ============= MAKE OUTPUT DIR =================== -->
    <mkdir dir="build"/>
    <!-- ================ XML => FO =================== -->
    <java  classpathref="classpath"
      <sysproperty key="xml.catalog.prefer"
      <sysproperty key="xml.catalog.files"
      <arg line="-x org.apache.xml.resolver.tools.ResolvingXMLReader"/>
      <arg line="-y org.apache.xml.resolver.tools.ResolvingXMLReader"/>
      <arg line="-r org.apache.xml.resolver.tools.CatalogResolver"/>
      <arg line="-o ${output.fo.path}"/>
      <arg line="${input.xml.path}"/>
      <arg line="${dbk.xsl.dir}/fo/docbook.xsl"/>
    <!-- ================ FO => PDF =================== -->
    <fop format="application/pdf" 


[Date Prev] | [Thread Prev] | [Thread Next] | [Date Next] -- [Date Index] | [Thread Index] | [List Home]