ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dave Pawson" <>
Subject Re: arg and jvmarg
Date Wed, 16 Apr 2008 12:32:38 GMT
On 16/04/2008, Steve Loughran <> wrote:

> > Saxon XSLT processor.
> > -o filename is the parameter. I'd always thought of it as one param.
> > Name (-o)
> > value (filename)
> > Ant seems to view it differently.
> >
>  Its two separate parameters when you break up the command line by spaces,
> which is what C main(char **argv)  does by the time every native program
> gets a look in. And The Java Runtime exec() call takes the same list of
> arguments, which is what ant sets up
>  When you go <arg line> ant splits up the line by spaces, and gets it wrong
> when there are spaces in filenames -just as the shell would. When you build
> it up using <arg value>, spaces in filenames get handled correctly.
>  If you build on on unix, you may not notice these problems, but other
> developers may hit the problem. Its safest, therefore, to use arg value,
> except in the special case that you want people who override your build file
> to include a whole list of custom arguments (like custom JVM
> properties/options).

I can see the simpler interpretation Steve, just looks odd from
the user perspective? Saxon does just the same as you say,
but processes arg pairs (for such as -o, -x etc).

I've given up with the xslt task now;
Need it to handle a different parser (xercesImpl) for xIncludes
and Apache resolver.jar for catalogs - I don't think
the xslt task can hack that?

I have it working as a java task

  <java classname="${xslt.processor.class}"
    <classpath refid="xslt.processor.classpath" />
    <jvmarg line="-Dorg.apache.xerces.xni.parser.XMLParserConfiguration=org.apache.xerces.parsers.XIncludeParserConfiguration"/>
    <jvmarg line="-Djavax.xml.parsers.DocumentBuilderFactory=org.apache.xerces.jaxp.DocumentBuilderFactoryImpl"/>
    <jvmarg line="-Djavax.xml.parsers.SAXParserFactory=org.apache.xerces.jaxp.SAXParserFactoryImpl"/>
    <arg value="-l"/>
    <arg value="-o"/>
    <arg value="${out.dir}/${main.outfile}"/>
    <arg line="-x"/>
    <arg line="-y"/>
    <arg line="-r "/>
    <arg line="${in.dir}/${main.infile} ${main.stylesheet}
${}" />

which will suffice!
(I'll stick with the <arg line/> notation till ant loses it, for readability.)


Dave Pawson

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message