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] | [Elist Home]


Subject: Re: DOCBOOK-APPS: Docbook/XML, done with Java


Matt:

I've used ant with XSLTproc, Xalan and (latest and greatest) with Saxon. The
build.xml file is listed below. Apologies to the list, wasn't sure if I
should send this to the list or privately.

Carlos


-- Begin build.xml file --
<?xml version="1.0" encoding="utf-8"?>
<!--
===================================================================
This is an ant project file to automate the creation of docbook based
documentation. It makes the following assumptions:

* You have ant installed on your system
* Saxon and FOP are installed on /usr/local
* The XSL stylesheets are installed on ./xsl/*
* You're using Saxon for XSLT processing

If you're not following the assumptions above, you need to modify the file
to make it fit your preferences, in particular, if you're not using Saxon,
do the following: 

        For XSLTProc, use the following line:
        <exec command="xsltproc xsl/xhtml/cal.xsl stories.xml"/>

        For Saxon (make sure that the following command is all in one line
        <exec command="java -cp
     
.:/usr/local/saxon/saxon.jar:/usr/local/xml-xerces/java/build/xerces.jar
        com.icl.saxon.StyleSheet -x
        org.apache.xerces.parsers.SAXParser stories.xml
        xsl/xhtml/cal.xsl "saxon.extensions=1"/>

        Although Ant tells you that the exec command is deprecated, I
        still have to figure out how does it work with the command
        they suggest you use
==================================================================== -->

<project name="Documents" default="all" basedir=".">
<target name="all">
    <antcall target="stories"/>
    <antcall target="naginata"/>
    <antcall target="streaming"/>
    <antcall target="administrator"/>
</target>
 
    
<target name="prepare-stories">
            <echo message="Document Name: Stories"/>
            <echo message="Preparing Directories and moving supporting
files"/>
            <delete dir="stories"/>
            <mkdir dir="stories"/>
        <mkdir dir="stories/images"/>
            <copy todir="stories/images">
            <fileset dir="images"/>
          </copy>
            <copy todir="stories" file="generic-style.css"/>
      </target>

      <target name="stories" depends="prepare-stories">
        <antcall target="stories-html-single"/>
        <antcall target="stories-html-chunk"/>
        <antcall target="stories-pdf"/>
    </target>

    <target name="stories-html-single">
        <echo message="Generating Single HTML File"/>
        <exec command="java -cp
.:/usr/local/saxon/saxon.jar:/usr/local/xml-xerces/java/build/xerces.jar
com.icl.saxon.StyleSheet -x org.apache.xerces.parsers.SAXParser -o
stories.html stories.xml xsl/xhtml/cal.xsl"/>
        <move file="stories.html" todir="stories"/>
    </target>

    <target name="stories-html-chunk">
                <echo message="Generating HTML Chunks"/>
        <exec command="java -cp
.:/usr/local/saxon/saxon.jar:/usr/local/xml-xerces/java/build/xerces.jar
com.icl.saxon.StyleSheet -x org.apache.xerces.parsers.SAXParser stories.xml
xsl/xhtml/cal-chunk.xsl"/>
                <move todir="stories">
                <fileset dir="." >
                        <include name="*.html"/>
                </fileset>
                </move>
    </target>

    <target name="stories-pdf">
        <echo message="Generating PDF File"/>
                <exec command="/usr/local/fop/fop.sh -xml stories.xml -xsl
xsl/fo/cal.xsl -pdf stories.pdf"/>
                <move file="stories.pdf" todir="stories"/>
                <echo message="Document Name: Stories. Done"/>
       </target> 

<!-- Begin Section for Naginata Article -->
<target name="prepare-naginata">
            <echo message="Document Name: Naginata"/>
            <echo message="Preparing Directories and moving supporting
files"/>
            <delete dir="naginata"/>
            <mkdir dir="naginata"/>
        <mkdir dir="naginata/images"/>
            <copy todir="naginata/images">
            <fileset dir="images"/>
          </copy>
            <copy todir="naginata" file="generic-style.css"/>
      </target>

      <target name="naginata" depends="prepare-naginata">
        <antcall target="naginata-html-single"/>
        <antcall target="naginata-html-chunk"/>
        <antcall target="naginata-pdf"/>
    </target>

    <target name="naginata-html-single">
        <echo message="Generating Single HTML File"/>
        <exec command="java -cp
.:/usr/local/saxon/saxon.jar:/usr/local/xml-xerces/java/build/xerces.jar
com.icl.saxon.StyleSheet -x org.apache.xerces.parsers.SAXParser -o
naginata.html why-naginata.xml xsl/xhtml/cal.xsl"/>
        <move file="naginata.html" todir="naginata"/>
    </target>
    <target name="naginata-html-chunk">
                <echo message="Generating HTML Chunks"/>
        <exec command="java -cp
.:/usr/local/saxon/saxon.jar:/usr/local/xml-xerces/java/build/xerces.jar
com.icl.saxon.StyleSheet -x org.apache.xerces.parsers.SAXParser
why-naginata.xml xsl/xhtml/cal-chunk.xsl"/>
                <move todir="naginata">
                <fileset dir="." >
                        <include name="*.html"/>
                </fileset>
                </move>
    </target>
    <target name="naginata-pdf">
        <echo message="Generating PDF File"/>
                <exec command="/usr/local/fop/fop.sh -xml why-naginata.xml
-xsl xsl/fo/cal.xsl -pdf naginata.pdf"/>
               <move file="naginata.pdf" todir="naginata"/>
               <echo message="Document Name: Stories. Done"/>
       </target> 

<!-- Begin targer for streaming paper -->
    <target name="prepare-streaming">
            <echo message="Document Name: QuickTime Exploration"/>
            <echo message="Preparing Directories and moving supporting
files"/>
            <delete dir="streaming"/>
            <mkdir dir="streaming"/>
        <mkdir dir="streaming/images"/>
            <copy todir="streaming/images">
            <fileset dir="appleimages"/>
            <fileset dir="images"/>
          </copy>
            <copy todir="streaming" file="generic-style.css"/>
                <copy todir="streaming" file="48.mp3"/>
      </target>

      <target name="streaming" depends="prepare-streaming">
        <antcall target="streaming-html-single"/>
        <antcall target="streaming-pdf"/>
    </target>

    <target name="streaming-html-single">
        <echo message="Generating Single HTML File"/>
        <exec command="java -cp
.:/usr/local/saxon/saxon.jar:/usr/local/xml-xerces/java/build/xerces.jar
com.icl.saxon.StyleSheet -x org.apache.xerces.parsers.SAXParser -o
streaming.html apple.xml xsl/xhtml/cal.xsl"/>
        <move file="streaming.html" todir="streaming"/>
    </target>
    <target name="streaming-pdf">
        <echo message="Generating PDF File"/>
                <exec command="/usr/local/fop/fop.sh -xml apple.xml -xsl
xsl/fo/cal.xsl -pdf streaming.pdf"/>
               <move file="streaming.pdf" todir="streaming"/>
               <echo message="Document Name: StreamingDone"/>
       </target> 
<!-- Begin target for administrator's training paper -->
<target name="prepare-administrator">
            <echo message="Document Name: administrator"/>
            <echo message="Preparing Directories and moving supporting
files"/>
            <delete dir="administrator"/>
            <mkdir dir="administrator"/>
        <mkdir dir="administrator/images"/>
            <copy todir="administrator/images">
            <fileset dir="images"/>
          </copy>
            <copy todir="administrator" file="generic-style.css"/>
      </target>
      <target name="administrator" depends="prepare-administrator">
        <antcall target="administrator-html-single"/>
        <antcall target="administrator-pdf"/>
    </target>
    <target name="administrator-html-single">
        <echo message="Generating Single HTML File"/>
        <exec command="java -cp
.:/usr/local/saxon/saxon.jar:/usr/local/xml-xerces/java/build/xerces.jar
com.icl.saxon.StyleSheet -x org.apache.xerces.parsers.SAXParser -o
admin.html webct-boot-camp.xml xsl/xhtml/cal.xsl"/>
        <move file="admin.html" todir="administrator"/>
    </target>
    <target name="administrator-pdf">
        <echo message="Generating PDF File"/>
                <exec command="/usr/local/fop/fop.sh -xml
webct-boot-camp.xml -xsl xsl/fo/cal.xsl -pdf admin.pdf"/>
                <move file="admin.pdf" todir="administrator"/>
                <echo message="Document Name: Administrator is  Done"/>
       </target> 
</project>










On 04/10/02 11:40, "Matt Reynolds" <mreynolds@pdxinc.com> wrote:

> My apologies if this is the wrong list.  I'm new here.
> 
> Here at work, we've decided to use DocBook for our internal
> documentation.  It appears to do everything we need, and we've started
> creating many documents already.
> 
> However, as we have varied levels of expertise, and various platforms to
> support, I've been trying to produce a "program" to process documents
> with DocBook through Java (I'm also a developer, and so if I need to
> build any wrappers or tools, I'd prefer to do it in my "comfort zone").
> 
> As far as I can tell, since we're using DocBook XSL, I should be able to
> simply use the appropriate stylesheets and process them against the XML
> documents we have.  (Is this correct?)
> 
> So far, I've tried using Ant 1.4.1 with Xerces/Xalan (whatever the
> latest ver is off of xml.apache.org) and the DocBook-XSL (from
> http://prdownloads.sourceforge.net/docbook/docbook-xsl-1.50.1-EXP.tar.gz
> ).  Currently, I'm getting "strange" errors processing documents with
> Xalan (which I'll be taking up with those folks shortly, the output is
> cryptic and terse, which doesn't help me much).
> 
> Regardless, I'm curious to know if anyone else out there is using an all
> Java setup?  Do you have any suggestions for me to try?  My goal is to
> process our DocBook XML with an automatable Java tool.
> 
> Also, just because I'm new to DocBook in general, how many of you are
> using DocBook XML?  I've been having difficulty using the SGML tools
> packaged with Debian when processing DocBook XML.  How popular is the
> XML side of DocBook?  What tools do you use?  Reference material?
> 
> I just want an automated process, dang it :)
> 
> Anyway, any and all help is appreciated.
> 
> Thanks,
> Matt Reynolds
> 

-- 
Carlos E. Araya
---+ WebCT Administrator/Trainer
 P | California Virtual Campus
 - | C/O De Anza College
 G | 21250 Stevens Creek Blvd
---+ Cupertino, CA 95014

email               carlos@cvc.edu
web                 http://www.cvc1.org/ (work)
                    http://www.silverwolf-net.net (personal)
phone               408 257 0420 (work)
PGP Fingerprint:    E629 5DFD 7EAE 4995 E9D7  3D2F 5A9F 0CE7 DFE7 1756

"A ship in harbor is safe, but that is not what ships are built for."
- William Shedd





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


Powered by eList eXpress LLC