The Saxon command line interfaces typically do a System.exit(2) if a
query/transformation fails with a dynamic error; this is so that
shell scripts can detect whether or not the command was successful.
There is no System.exit() call if execution succeeds.
I don't think anyone is especially at fault here. You're using an
interface that's designed to be called from a shell script from
within a Java application, which is best avoided, but Ant doesn't
give you very much alternative. If you really want to make the
effort, the right answer is probably to write a different wrapper
around the Query API, similar to net.sf.saxon.Query, but with a
different strategy for reporting success or failure to the calling
application. Alternatively, write the query to be more robust, so it
doesn't fail with dynamic errors: I don't think there should be a
problem for successful queries.
Another alternative: perhaps you should be using XProc?
On 08/03/2012 12:09, Tom Cleghorn wrote:
I've got an Ant build in which I
the "java" task to pull a couple of values from an XML document
and store them in properties for use later in the build.
Currently, the tasks look like
...and this works. However, I
builds where setting the result of an Xquery to a property would
useful, but where I have quite a few more properties to set. So,
really like to do is be able to use 'fork="false"', so that I
don't have to wait for a new VM to start up for each property,
does not work. If I do this, I get "Java Result: 2" from Ant,
and the properties remain unset.
I played around a bit, and found
Saxon was complaining about Java security permissions, and that
finding that, if I specifically granted Saxon all permissions,
run without error, but then end the build prematurely - with
fiddling, I found that granting Saxon all permissions *except*
give me Java Result: 2 again. So it looks as if Saxon really
wants to close
the VM when it finishes, but with fork=false, this is the VM in
is running - is this the right conclusion? I'm using Ant 1.8.1,
9.1 and Java 1.6, but I've also tried with Ant 1.7.0, 1.7.1 and
and Saxon HE 9.3 and 9.4.
I'm really running up against the
of my understanding of Java here, so I'm honestly unsure if I'm
daft, and even if I'm not, whether it's Saxon, Ant, or Java
causing the problem. Can anyone shed any light?
Virtualization & Cloud Management Using Capacity Planning
Cloud computing makes use of virtualization - but cloud computing
also focuses on allowing computing to be delivered as a service.
saxon-help mailing list archived at http://saxon.markmail.org/