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: Transforming with ant: resolver class not found error

Migrating from make to ant (new to me), working with 
http://www.dpawson.co.uk/docbook/ant.html and a bunch of other 
references, but can't seem to load the entity resolver. For example, 
can anyone suggest how this make rule would map to an ant task?

This make excerpt generates the olink database for one page:

$html.homepage.olinks.db :  ${SRC}/index.xml
	java -cp "${XformCp} \
	-Djavax.xml.parsers.DocumentBuilderFactory=${DBFACTORY} \
	-Djavax.xml.parsers.SAXParserFactory=${SPFACTORY} \
	-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=${XPCONFIG} \
	com.icl.saxon.StyleSheet \
	-r org.apache.xml.resolver.tools.CatalogResolver \
	-y org.apache.xml.resolver.tools.ResolvingXMLReader \
	-x org.apache.xml.resolver.tools.ResolvingXMLReader \
	${SRC}/index.xml \
	${XSLDIR}/html/docbook.xsl \
	collect.xref.targets="only" \
  	use.id.as.filename="1" \
	current.docid="homepage" \

When I map to ant the sticking points so far are:

  * I can only specify the system "-D" options on the command line.
    Can you do it in the ant build.xml?

  * Error: "Failed to load com.sun.resolver.tools.CatalogResolver"
    Note that the same classpaths work in the makefile.

Here's the command I'm running:
$ ant  -Djavax.xml.parsers.DocumentBuilderFactory=$DBFACTORY \
        -Djavax.xml.parsers.SAXParserFactory=$SPFACTORY \
        -Dorg.apache.xerces.xni.parser.XMLParserConfiguration=$XPCONFIG \
        -f misc/dbdocs.xml

.. and here's the essential part of my ant file (misc/dbdocs.xml):

<project name="dbdocs" default="html">

<description>ant build file for docbook documents</description>

    <property name="build.dir"    location="${user.dir}" />
    <path id="xslt.processor.classpath">
        <pathelement path="${doctool.dir}/tools/saxon/saxon.jar" />
        <pathelement path="${doctool.dir}/tools/xerces/xercesImpl.jar" />
        <pathelement path="${doctool.dir}/tools/xerces/xml-apis.jar" /> 

        <pathelement path="${doctool.dir}/tools/resolver/resolver.jar" />
        <pathelement path="${doctool.dir}/catalog" />
        path="${doctool.dir}/xsl/docbookxsl/extensions/saxon653.jar" />

<target name="html">

<java classname="${xslt.processor.class}"
	<classpath refid="xslt.processor.classpath" />
<!-- These don't work, have to pass in on command line
        <arg value="-Djavax.xml.parsers.DocumentBuilderFactory
              ${DBFACTORY}" />
        <arg value="-Djavax.xml.parsers.SAXParserFactory
              ${SPFACTORY}" />
        <arg value="-Dorg.apache.xerces.xni.parser.XMLParserConfiguration
              ${XPCONFIG}" />
	<arg line="-x com.sun.resolver.tools.ResolvingXMLReader"/>
	<arg line="-y com.sun.resolver.tools.ResolvingXMLReader"/>
	<arg line="-r com.sun.resolver.tools.CatalogResolver"/>
	<arg line="${in.dir}/$index.xml
	<arg line="collect.xref.targets='only' use.id.as.filename='1'
              targets.filename='${olink.dir}/html.homepage.olinks.db' "/>



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