You may want to use the
Transformer.setParameter("dir", outputdir);
where the outputdir is the String specifying where you want your output to be
written.
And then in the your stylesheet do something like
<redirect:write select=concat($dir, "sub/dir/[EMAIL PROTECTED]")>
Adolfo
-----Original Message-----
From: Brown, Charles [mailto:[EMAIL PROTECTED]
Sent: Wednesday, July 13, 2005 10:48 AM
To: [email protected]
Subject: Redirect:write mangles file names on windows
If I'm off topic, please let me know.
I'm trying to get redirect:write to put a file in a relative
subdirectory, so I have the following
<redirect:write file="sub/dir/[EMAIL PROTECTED]">
On linux, :write converts the relative file name into an absolute file name,
but it works fine, and the file ends up where I want it.
/home/cbrown/workspace/sub/dir/myFile.txt
On windows, :write tries to convert the relative file name into an absolute
file name, but gets it mangled into;
:C:\Documents and
Settings\CBROWN\workspace\sub\dir\sub\dir\myFile.txt
Which has two problems. First, the initial colon (:) makes the filename
illegal, causing a FileNotFoundException to be thrown. Second, the
"sub\dir\" gets repeated, resulting in a bad path.
Any thoughts on avoiding this?
Thanks.
--CB