Return-Path: Delivered-To: apmail-ant-user-archive@www.apache.org Received: (qmail 53956 invoked from network); 21 Jan 2009 15:23:52 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 21 Jan 2009 15:23:52 -0000 Received: (qmail 28401 invoked by uid 500); 21 Jan 2009 15:23:48 -0000 Delivered-To: apmail-ant-user-archive@ant.apache.org Received: (qmail 28353 invoked by uid 500); 21 Jan 2009 15:23:48 -0000 Mailing-List: contact user-help@ant.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list user@ant.apache.org Received: (qmail 28342 invoked by uid 99); 21 Jan 2009 15:23:48 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Jan 2009 07:23:48 -0800 X-ASF-Spam-Status: No, hits=0.2 required=10.0 tests=SPF_PASS,WHOIS_MYPRIVREG X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.223.124.7] (HELO albatros.unitedhosting.co.uk) (83.223.124.7) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Jan 2009 15:23:39 +0000 Received: from www.oopsconsultancy.com (localhost.localdomain [127.0.0.1]) by albatros.unitedhosting.co.uk (8.13.1/8.13.1) with ESMTP id n0LFNI54025323 for ; Wed, 21 Jan 2009 15:23:18 GMT Received: from 62.129.121.63 (SquirrelMail authenticated user bagnew@oopsconsultancy.com) by www.oopsconsultancy.com with HTTP; Wed, 21 Jan 2009 15:23:18 -0000 (GMT) Message-ID: <31095.62.129.121.63.1232551398.squirrel@www.oopsconsultancy.com> In-Reply-To: <345520A34347BA49B798F70B218ACD1305C252FEC1@MERCMBX14.na.sas.com> References: <9EE86F1965E19E499C80DE52AC807B5502A47958@z011021.bk.fin.local> <7677347A-5ECB-45A9-ACFE-8BC7A95CE24E@thortech-solutions.com> <345520A34347BA49B798F70B218ACD1305C252FEC1@MERCMBX14.na.sas.com> Date: Wed, 21 Jan 2009 15:23:18 -0000 (GMT) Subject: RE: AW: Modify xml file From: "Brian Agnew" To: "Ant Users List" User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Checked: Checked by ClamAV on apache.org Hi - For XML files, XMLTask will manage correct entity escaping and character encoding. http://www.oopsconsultancy.com/software/xmltask/ Brian On Wed, January 21, 2009 14:22, Alec Fernandez wrote: > You should exercise caution when using replace to substitute tokens in xml > files and property files because some chars &<>'" need to be escaped in > xml files. > > You need to be sure that the string that you are inserting into the xml > will never have such characters, or you must escape yourself. > > Similarly there are chars (\ and non-Latin 1 chars) that need escaping in > .properties files. > > If someone knows of an elegant solution to inserting such strings into > files using ant, I would be grateful for the input. > >>> -----Original Message----- >>> From: Brian Stephenson [mailto:bstephenson@thortech-solutions.com] >>> Sent: Wednesday, January 21, 2009 2:36 PM >>> To: Ant Users List >>> Subject: Re: AW: Modify xml file >>> >>> Just as a followup, I do a similar thing as #3 in a project I am >>> ANT'ing, and if you are not replacing in the XML file using regular >>> expressions (e.g., you are just replacing 'password="foo"' with >>> 'password="bar"'), you may be able to accomplish what you need to do >>> with the much simpler-to-use command REPLACE, which does straight >>> string replacement without regular expressions. Best thing about >>> REPLACE is that you can replace characters that are considered escape >>> characters in regular expressions (*, /. etc.). I refer you to >>> apache.org's ANT manual for the syntax of the REPLACE command, but if >>> you want to use an external config file to manipulate, I think this >>> might be the way to do it. >>> >>> Brian Stephenson >>> ThorTech Solutions >>> www.thortech-solutions.com >>> >>> >>> >>> On Jan 21, 2009, at 7:49 AM, wrote: >>> >>> > There are multiple options: >>> > 1. create two hibernate files and select only one of them while >>> > copying using conditional patternset . >>> > 2. create a template and fill in the the values >>> > >>> > 3. modify the config file with >>> > 4. modify the config file with (external task) >>> > >>> > >>> > Jan >>> > >>> >> -----Urspr�ngliche Nachricht----- >>> >> Von: jeusdi [mailto:cabrejcr@terra.es] >>> >> Gesendet: Mittwoch, 21. Januar 2009 13:43 >>> >> An: user@ant.apache.org >>> >> Betreff: Modify xml file >>> >> >>> >> >>> >> Hello list. >>> >> >>> >> I'm using Hibernate in my web project. I've created an Ant >>> >> file in order to >>> >> create a war and deploy it to my remote tomcat. The problem is >>> >> locally I >>> >> test my database access with a user/password database. So, >>> >> Hibernate has a >>> >> hibernate.cfg.xml, in order to set the user and password to access >>> to >>> >> database with. So, I need to change these fileds previously to >>> >> war task. How >>> >> Can I to it? >>> >> >>> >> Thanks. >>> >> I will appreciate your help a lot. >>> >> -- >>> >> View this message in context: >>> >> http://www.nabble.com/Modify-xml-file-tp21582407p21582407.html >>> >> Sent from the Ant - Users mailing list archive at Nabble.com. >>> >> >>> >> >>> >> ------------------------------------------------------------------- >>> -- >>> >> 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 >>> > >>> >>> >>> > > > --------------------------------------------------------------------- > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org > For additional commands, e-mail: user-help@ant.apache.org > > -- Brian Agnew http://www.oopsconsultancy.com OOPS Consultancy Ltd Tel: +44 (0)7720 397526 Fax: +44 (0)20 8682 0012 --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscribe@ant.apache.org For additional commands, e-mail: user-help@ant.apache.org