possibly taskdef org/apache/tools/ant/util/FileUtils.java http://www.docjar.com/html/api/org/apache/tools/ant/util/FileUtils.java.html
call normalize method e.g. clean_path=FileUtils.normalize(String path) on path to clean it then set clean linted path to property *Gruss* Martin ______________________________________________ Verzicht und Vertraulichkeitanmerkung Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfaenger sein, so bitten wir hoeflich um eine Mitteilung. Jede unbefugte Weiterleitung oder Fertigung einer Kopie ist unzulaessig. Diese Nachricht dient lediglich dem Austausch von Informationen und entfaltet keine rechtliche Bindungswirkung. Aufgrund der leichten Manipulierbarkeit von E-Mails koennen wir keine Haftung fuer den Inhalt uebernehmen. > Date: Wed, 5 Aug 2009 20:29:53 +0200 > From: michael.stuttg...@gmx.de > To: user@ant.apache.org > Subject: converting slashes in attributes of script tasks in macrodefs > > > I have the following problem with ant 1.7.1 on windows > example where the first / of property2 ist first converted > plattformspecifc to \ because ${basedir} is used and then dropped inside > the javascript. > How can I avoid this, that i have the original value inside the script? > > Output: > [echo] demo1=c:/download/sub1 > [echo] demo2=c:\download/sub2 > [echo] demo1=c:/download/sub1 > [echo] demo2=c:download/sub2 > > Examplescript: > > <project name="MyProject" default="demo" basedir="c:/download"> > <target name="demo"> > <property name="p1" value="c:/download/sub1"/> > <property name="p2" value="${basedir}/sub2"/> > <testatt demo1="${p1}" demo2="${p2}"/> > </target> > > <macrodef name="testatt"> > <attribute name="demo1" default="default" /> > <attribute name="demo2" default="default" /> > <sequential> > <echo>dem...@{demo1}</echo> > <echo>dem...@{demo2}</echo> > <script language="javascript"> > <![CDATA[ > a1="@{demo1}"; > a2="@{demo2}"; > echo = project.createTask("echo"); > echo.setMessage("demo1="+a1); > echo.perform(); > echo.setMessage("demo2="+a2); > echo.perform(); > ]]> </script> > > </sequential> > </macrodef> > > > </project> > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscr...@ant.apache.org > For additional commands, e-mail: user-h...@ant.apache.org > _________________________________________________________________ Windows Liveā¢: Keep your life in sync. http://windowslive.com/explore?ocid=PID23384::T:WLMTAGL:ON:WL:en-US:NF_BR_sync:082009