I think that the problem is not with style, but with the fact that the variable
$filename already contains a directory.
Basically, if you have the following xml file:
d:\temp\bla\woodle.xml
the regex task would set the filename variable to d:\temp\bla\woodle
So style is bassically called with:
<style style="${xsl.dir}/StyleSheet.xsl"
in="d:\temp\bla\woodle.xml"
out="d:\temp\bla\woodle.html"/>
If you prepend another directory to the out attribute, it's not gonna work.
In order to exclude the path from filename, you'll have to change the regular
expression to something like ^.*[\/](?'filename'.*).xml$
The result would be:
<foreach item="File" in="${xml.dir}"
property="xml.filename">
<regex pattern="^.*[\/](?'filename'.*).xml$"
input="${xml.filename}"/>
<style style="${xsl.dir}/StyleSheet.xsl"
in="${filename}.xml"
out="${html.dir}/${filename}.html"/>
</foreach>
where html.dir is the directory which will contain the html. This should work.
A
> -----Original Message-----
> From: Griffin Caprio [mailto:[EMAIL PROTECTED]
> Sent: Thursday, March 20, 2003 8:31 PM
> To: Arjen Poutsma; Gerry Shaw
> Cc: Nant-Developers (E-mail)
> Subject: RE: [nant-dev] Substring?
>
>
> ok, tried this and it works GREAT!
>
> Thanks for the RegEx task.
>
> However, one of the minor things I tried is to tack on
> a directory to the out variable. Right away, NAnt
> blew up with a "NotSupportedException"
>
> Any plans on adding this or do I have to just manually
> copy the files with the <copy> task?
>
> Thanks,
>
> Griffin
> > So, what Griffin wanted (extracting the filenames of
> > xml files) can be accomplished as such:
> >
> > <foreach item="File" in="${xml.dir}"
> > property="xml.filename">
> > <regex pattern="^(?'filename'.*).xml"
> > input="${xml.filename}"/>
> > <style style="${xsl.dir}/StyleSheet.xsl"
> > in="${filename}.xml"
> > out="${filename}.html"/>
> > </foreach>
>
> =====
> Griffin Caprio
> "Your child against mine. The winner
> will be hailed, the loser will be booed
> until my throat hurts!" - Homer Simpson to Marge
>
> __________________________________________________
> Do you Yahoo!?
> Yahoo! Platinum - Watch CBS' NCAA March Madness, live on your desktop!
> http://platinum.yahoo.com
>
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Nant-developers mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/nant-developers