Thread view

Hello,
I raised this issue on the xsl-list last week, so I apologize for
cross-posting.
I try to use the saxon ant task (via saxon9-ant.jar) in connection with
an xmlcatalog, and it fails. Here is my code:
<xslt2 in="${src_file}" out="${build}/trash.xml"
style="${lib}/tools/test.xsl" force="true">
<param name="files_prefix" expression="${files_prefix}"/>
<xmlcatalog refid="catalog"/>
</xslt2>
with
<xmlcatalog id="catalog">
<entity publicid="http://www.editura.de/docs/test2.xsl";
location="lib/docs/test2.xsl"/>
</xmlcatalog>
and
<taskdef name="xslt2" classname="net.sf.saxon.ant.AntTransform"
classpath="${Saxon9.classpath};${Saxon9-Ant.classpath}"/>
The test.xsl imports the test2.xsl, which is not present under the given
URL. With the <xslt/>-ant-task the resolving works fine, but the above
fails with XTSE0165: java.io.FileNotFoundException:
http://www.editura.de/docs/test2.xsl
BTW, the pure Saxon way works well:
<xslt in="${src_file}" out="${build}/trash.xml"
style="${lib}/tools/test.xsl" force="true">
<param name="files_prefix" expression="${files_prefix}"/>
<xmlcatalog refid="catalog"/>
<classpath location="${Saxon9.classpath}" />
</xslt>
I use Ant 1.7.1 , Saxon 9.1.0.5J and saxon9-ant.jar v9.1 on WinXP with
Java 1.6.0_11. The latest resolver.jar from the xsl-commons-project is
in the ant/lib directory.
Have you any suggestion to make this work?
Thanks,
Stefan Krause

Hello,
Robert Koberg schrieb:
> Try:
>
> <xmlcatalog id="catalog">
> <catalogpath>
> <fileset dir="lib/docs">
> <include name="**/*.xsl"/>
> <!--<include name="**/*.dtd"/>
> <include name="**/*.xsd"/>
> <include name="**/*.xml"/>-->
> </fileset>
> </catalogpath>
> </xmlcatalog>
>
I've tried dozens of variants of this and no one does the job. Even the
built-in <xslt/>-task (with saxon9-classpath) fails.
Also another attempt with an external catalog.xml fails. As far as I
understand the debugging messages (I'm not a programmer), there is an
ant-internal error during parsing the catalog file.
I'm afraid it is like you wrote: catalogs in ant are hairy beasts.
Regarding to Michaels statement I'm not sure whether further efforts are
worthwhile, since the classpath-solution for the xslt-task works (if
saxon-specific capabilities are not required).
Thanks,
Stefan

Deleting the doctype reference from the catalog file (the same that in
Oxygen works fine) lets the core <xslt/>-task run, but the <xslt2/>-task
is still broken.
The CatalogManager.properties did not change anything.
I think we should stop here, because Ant shows a really weird,
unpredictable behavior, and try & error is very time consuming...
Thanks for your suggestions,
Stefan
Robert Koberg schrieb:
> Have you tried using an Oasis catalog rather than the built in Ant
> xmlcataog style catalog? For example, I might have a catalog that
> looks like:
>
> <catalog prefer="public" xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog
> ">
> <rewriteSystem
> systemIdStartString="http://hibernate.sourceforge.net/";
> rewritePrefix="file:///home/me/some/path/to/catalog-
> resources/" />
> </catalog>
>
> Then I place a CatalogManager.properties file in my classpath (I put
> mine in the fileset dir for the catalogpath). My properties look like:
>
> catalogs=./catalog.xml;
> relative-catalogs=false
> verbosity=1
> prefer=public
> static-catalog=yes
> allow-oasis-xml-catalog-pi=yes
> catalog-class-name=org.apache.xml.resolver.Resolver
>
> and I use the xmlcatalog element like I displayed below.
>
> best,
> -Rob