ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <ddevie...@gmail.com>
Subject Re: Command line arguments with <java> task.
Date Tue, 08 Aug 2006 15:16:56 GMT
> So far that problem is still unresolved.

Have you tried using -lib saxon.jar on the command line? This puts
saxon first on the classpath, which makes Trax load it instead of the
default JDK-provided XSLT engone.

>  <arg value="-l -a"/>
>  <arg line="-l -a"/>
> To my eye, these appear to be indentical. Which one is wrong?

the 'value' one is wrong. "-l -a" is not an argument. "-l" and "-a" are.

> <target name="gen-properties" depends="init">
>  <java classname="net.sf.saxon.Transform" fork="true">
>    <classpath>
>      <pathelement location="${env.SAXON_HOME}/saxon8.jar" />
>    </classpath>
>    <arg value="-o ${env.SARS_REPORTS_HOME}\lib\temp\pbd.xml" />

Use 'line' instead. Better yet, using

    <arg value="-o" />
    <arg file="${env.SARS_REPORTS_HOME}/lib/temp/pbd.xml" />

Notice the forward-slash. 'value' and 'line' are string-based args,
that don't assume anything about the args. 'file' knows it's a
filename, and "does the right thing" (TM) to convert into a proper
filename for the current platform.

>    <arg value="${env.SARS_REPORTS_HOME}/lib/federal-holidays.xml" />
>    <arg value="${env.SARS_REPORTS_HOME}/lib/previous-bus-day.xslt" />

Again, better to use 'file' above.

>    <arg value="dow=${day.of.week}" />
>    <arg value="span=${span}" />
>    <arg value="current-date=${current.date}" />

This is correct OTOH. Even if span (or the other properties) contain
spaces, you most likely want to pass it in as a single argument.

>  </java>
> </target>

With these changes, should work fine. --DD

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


Mime
View raw message