ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Pawson" <dave.paw...@gmail.com>
Subject Re: ant tasks for converting from docbook ?
Date Wed, 23 Apr 2008 15:47:50 GMT
On 23/04/2008, Ronald Johnson <rj.1970@googlemail.com> wrote:
> Hi,
>
>  what are the "standard" (i.e. the tasks many people use) for
>  converting docbook to html/pdf ?
>  What library is most common used for this task (or is it possible to
>  do it with the tasks that are delivered with ant?)
>
>  If anyone have examples I would be greatful,


<target name="docbook" depends="init, clean, validate">
  <java classname="${xslt.processor.class}"
	fork="yes"
	dir="${in.dir}"
	failonerror="true">
    <classpath refid="xslt.processor.classpath" />
    <jvmarg line="-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration"/>
    <jvmarg line="-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
    <jvmarg line="-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
    <arg value="-l"/>
    <arg value="-o"/>
    <arg value="${out.dir}/${main.outfile}"/>
    <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="${in.dir}/${main.infile} ${main.stylesheet}
${param.args.post}" />
  </java>
  <tstamp>
    <format property="fintim" pattern="E @ H:m a" locale="en,UK"/>
  </tstamp>
  <echo>Finished at ${fintim}</echo>
</target>


Provides a chunked html output.

<target name="fo" depends="init, validate, clean.pdf">
<echo>Generate the fo output</echo>
<java classname="${xslt.processor.class}"
      fork="yes"
      dir="${in.dir}"
      failonerror="true">
  <classpath refid="xslt.processor.classpath" />
  <jvmarg value="-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration"/>
  <jvmarg value="-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
  <jvmarg value="-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
<arg value="-l"/>
  <arg value="-o"/>
  <arg value="${out.fo.dir}/${main.fo.outfile}"/>
  <arg value="-x"/>
  <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
  <arg value="-y"/>
  <arg value="org.apache.xml.resolver.tools.ResolvingXMLReader"/>
  <arg value="-r"/>
  <arg value="org.apache.xml.resolver.tools.CatalogResolver"/>
  <arg value="${in.dir}/${main.infile}"/>
  <arg value="${main.fo.stylesheet}" />
</java>
</target>

Provides the fo output. Calling fop is easier than xep or ah.

HTH



-- 
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message