Re: [xsl] Ant XSLT task issues - redo

Subject: Re: [xsl] Ant XSLT task issues - redo
From: "Tony Graham tgraham@xxxxxxxxxxxxx" <xsl-list-service@xxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 21 May 2024 12:37:58 -0000
Sorry to be late to the party...

On 19/02/2024 15:39, dvint dvint@xxxxxxxxx wrote:
I posted her as an XSLT adjacent question. I figured if anyone was
using ant with xslt it would be here.

I would have thought so, too.


Since posting, I continued to work on the problem. For the record, I
 dropped the use of the xslt task and switched to the Java task to
run my stylesheets. For whatever reason, I was having issues with
getting a catalog resolver to work with the  xslt task. The ant error
was a

Catalog resolution with Ant is hit-and-miss. I've sometimes added 'resolver.jar' to the Saxon directory or the Ant 'lib' directory, and sometimes recreated the catalog as an <xmlcatalog> in the Ant build file.

generic I/O message which I discovered was an issue about not finding
 the DTD. After switching to Java, I discovered that the xslt task
had an optimization feature, that if the stylesheet or content hadn't
changed, it skipped running. I never verified, but that added to the
flakiness I

As Syd said in February, it's (usually) a feature, not a bug.


I use XSLT to scan the real XSLT for <xsl:include> and <xsl:import> and
generate a temporary Ant build file with Ant <path> elements for the
dependencies of every XSLT file.  The real build file imports that file.

For an example, see:

- https://github.com/MarkupUK/MUK-proc/blob/543172ee0acc44a9d71fffe9a206bca0d3d6b1d6/build.xml#L157
- https://github.com/MarkupUK/MUK-xsl/blob/6e168f4ff08b9c3501bf842b498cca41a9a927b3/ant-paths.xsl


For an explanation (as part of something more convoluted) see:

- https://inasmuch.as/2013/12/10/multi-stage-xslt-in-ant/

It all works because both XSLT files and Ant files are XML.

Regards,


Tony Graham. -- Senior Architect XML Division Antenna House, Inc. ---- Skerries, Ireland tgraham@xxxxxxxxxxxxx

Current Thread