On 16/04/2008, Steve Loughran <[EMAIL PROTECTED]> 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}"
        fork="yes"
        dir="${in.dir}"
        failonerror="true">
    <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 org.apache.xml.resolver.tools.ResolvingXMLReader"/>
    <arg line="-y org.apache.xml.resolver.tools.ResolvingXMLReader"/>
    <arg line="-r org.apache.xml.resolver.tools.CatalogResolver "/>
    <arg line="${in.dir}/${main.infile} ${main.stylesheet}
${param.args.post}" />
  </java>

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


regards



-- 
Dave Pawson
XSLT XSL-FO FAQ.
http://www.dpawson.co.uk

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to