ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dwayne Schultz <>
Subject Re: xslt task with foreach
Date Fri, 07 Feb 2003 19:23:11 GMT
On Friday, Feb 7, 2003, at 05:25 US/Pacific, Cox, Charlie wrote:

> I'm having trouble getting this task to work. What I need is to run an 
> xslt
> task for each file in the directory and I need the filename to be 
> passed as
> a parameter to the xslt.

Have you looked at systemId()?  It's an XPath function in the namespace but I am sure Xalan has a similar 
function.  We do something like this:

<xsl:value-of select="substring-after(saxon:systemId(), $SourceDir)"

where $SourceDir is passed into the task like:

<param name="SourceDir" expression="${basedir}"/>

Should get you the path relative to basedir like "dir/file.xml".


View raw message