DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT <http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5515>. ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND INSERTED IN THE BUG DATABASE.
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=5515 Replace Task -- carriage returns Summary: Replace Task -- carriage returns Product: Ant Version: 1.4.1 Platform: Other OS/Version: Windows NT/2K Status: NEW Severity: Normal Priority: Other Component: Core tasks AssignedTo: [EMAIL PROTECTED] ReportedBy: [EMAIL PROTECTED] The problem: I have a replace task, defined like this in my build.xml file: <replace file="${work-dir}/WEB-INF/web.xml" summary="true"> <replacetoken><![CDATA[<param-name>mail-enabled</param-name> <param-value>false</param-value>]]></replacetoken> <replacevalue><![CDATA[<param-name>mail-enabled</param-name> <param-value>true</param-value>]]></replacevalue> </replace> Although the replace token exists in my the source file, ant never replaces the token with my desired value. I think it has something to do with the following code snippet (org.apache.tools.ant.taskdefs.Replace, line 324...): String linesep = System.getProperty("line.separator"); String val = stringReplace(value.getText(), "\n", linesep); String tok = stringReplace(token.getText(), "\n", linesep); // for each found token, replace with value log("Replacing in " + src.getPath() + ": " + token.getText() + " --> " + value.getText(), Project.MSG_VERBOSE); newString = stringReplace(newString, tok, val); According to section 2.11 of the XML 1.0 spec, XML processors normalize end-of- line characters for you, so the first three lines of this snippet are unnecessary. Unfortunately, I don't have a whole lot of time to figure out exactly why calling stringReplace with those parameters fails, but I did get it to work correctly by changing the last line of that code snippet to this: newString = stringReplace(newString, token.getText(), value.getText()); -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
