ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chad Armstrong <chad.armstr...@gmail.com>
Subject Re: character replace
Date Fri, 22 Jul 2005 21:39:24 GMT
Nope, I take it back, read my output wrong. Here is a little more
info. Commented sections are outputs:
--------------------------------------------------------
<echo message="here is MSVC.Pre-Link.RESOURCE_DEF:
${MSVC.Pre-Link.RESOURCE_DEF}" />

<!--      [echo] here is MSVC.Pre-Link.RESOURCE_DEF:
WIN32;NDEBUG;_WINDOWS;_USRDLL;ESPANALYTICS_EXPORTS;NOMINMAX;RW_NO_STL;_CREATE_MBS_DLL_
-->    
    <script language="javascript">
    <![CDATA[
      strResourceDef = project.getProperty("MSVC.Pre-Link.RESOURCE_DEF");
      strReplace = strResourceDef.replaceAll(";","\r\n");
      project.setProperty("RESOURCE_DEF_REPLACE", strReplace);
    ]]>
    </script>
         
    <echo message="here is RESOURCE_DEF_REPLACE: ${RESOURCE_DEF_REPLACE}" />

<!--     [echo] here is RESOURCE_DEF_REPLACE: WIN32
     [echo] NDEBUG
     [echo] _WINDOWS
     [echo] _USRDLL
     [echo] ESPANALYTICS_EXPORTS
     [echo] NOMINMAX
     [echo] RW_NO_STL
     [echo] _CREATE_MBS_DLL_
-->
---------------------------------------------
Still returns actual parsed newlines instead of the string "\r\n".

thanks
Chad

On 7/22/05, Chad Armstrong <chad.armstrong@gmail.com> wrote:
> Oh man- *blushes* yes that worked.
> 
> Thanks
> 
> On 7/22/05, Alexey N. Solofnenko <A.Solofnenko@mdl.com> wrote:
> > You do not have to escape back slashes in XML - just put "\r\n".
> >
> > - Alexey.
> >
> > Chad Armstrong wrote:
> > > Hello all,
> > >   Today seems to be regular expression day on the list, so here is my input
;)
> > >
> > >   I have a block of code in my build script:
> > >
> > >     <script language="javascript">
> > >     <![CDATA[
> > >       strResourceDef = project.getProperty("MSVC.Pre-Link.RESOURCE_DEF");
> > >       strReplace = strResourceDef.replaceAll(";","\\r\\n");
> > >       project.setProperty("RESOURCE_DEF_REPLACE", strReplace);
> > >     ]]>
> > >     </script>
> > >
> > >   What this is supposed to do is is transform a string like
> > > string;string;string; into string\r\nstring\r\nstring\r\n, but the
> > > above transforms to stringrnstringrnstringrn, and using \r\n or
> > > \\\r\\\n causes actual newlines to be output, which is not what I
> > > want. I've tried using entities as well and they just get output
> > > verbatim.  Any clues?
> > >
> > > thanks
> > > Chad
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > > For additional commands, e-mail: user-help@ant.apache.org
> > >
> >
> > --
> > ------------------------------------------------------------------------
> > / Alexey N. Solofnenko
> > home: http://trelony.cjb.net/
> > /
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> >
> >
>

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message