ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jonathan Shipley">
Subject RE: style / passing in filename
Date Sat, 17 Aug 2002 10:03:57 GMT
No, sorry. ${ant.file} gives the name of the build file. What I am after
is the name of the current file being processed. E.g.

 <style extension=".html" basedir="xml" style="style/page.xsl"
	destdir="build" includes="*.xml" excludes="nav.xml">
	<param name="srcXml" expression="${current.file}"/>

The style task is operating on a whole directory of xml files. Each file
is being transformed by the same stylesheet. My made-up idea is that
$current.file would be the name of the current file in the directory,
and could be passed in to the stylesheet. I could then do something with
it in the XSLT. As of yet I have no idea how to do this from a build

I have considered storing the filename in the xml, but this seems like a
redundant step, and one that I am reluctant to take.

You can also extend the functionality using javascript, but then you get
into having to handle your own file/directory parsing and ant already
does this brilliantly.

If it is not possible to do something like this (at least easily anyway)
why should ant not automatically pass the current filename in (from the
style task) using a reserved variable name? e.g. srcXml. Developers
could then use it or not as they needed. It would only be a single line
of code to add this feature in...

Thanks anyway,

Jonathan Shipley

-----Original Message-----
From: Matt Benson []
Sent: 16 August 2002 18:08
To: Ant Users List
Subject: Re: style / passing in filename

I'm not sure what you are after, but will the built-in
Ant property ${ant.file} help you accomplish what you


--- Jonathan Shipley <> wrote:
> I would appreciate an answer on how to pass in the
> current filename as a
> param to the stylesheet in a batch style task; even
> if, as I suspect, it
> is not possible.
> Is there really no-one involved with the
> presentation layer?
> Thanks in advance,
> --
> Jonathan Shipley
> --
> To unsubscribe, e-mail:
> <>
> For additional commands, e-mail:
> <>

Do You Yahoo!?
HotJobs - Search Thousands of New Jobs

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

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

View raw message