Re: Regular expression to match non-breaking spaces
Peter, >> > flags="g" byline="true" encoding="utf-8" /> I assume that Ant's XML parse will digest your character reference. In effect you are doing nothing more than Have you tried something like instead? // Wolfgang On Sat, Mar 12, 2011 at 12:48 AM, Brian Agnew wrote: > You might want to try XMLTask, which reads XML natively and handles the > specified character encodings. It'll do regexp replacements. > > http://www.oopsconsultancy.com/software/xmltask > > On 11/03/2011 18:26, Peter Desjardins wrote: >> >> Hi. I'm trying to replace every non-breaking space character in a file >> with a normal space character. The source file is encoded using UTF-8. >> I can't get this to work using the replaceregexp task. Here's the >> syntax I'm using: >> >> > flags="g" byline="true" encoding="utf-8" /> >> >> I've tried other ways to match non-breaking spaces ( \0240 >> U+00A0) but have had no success yet. I didn't alter the regular >> expression libraries in my Ant installation. Is that what I need to >> do? Or is there a string I can put into the match attribute that will >> match UTF-8 non-breaking spaces? >> >> Thanks for your help. >> >> Peter Desjardins >> >> - >> To unsubscribe, e-mail: user-unsubscr...@ant.apache.org >> For additional commands, e-mail: user-h...@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-unsubscr...@ant.apache.org > For additional commands, e-mail: user-h...@ant.apache.org > > -- Wolfgang Häfelinger häfelinger IT - Applied Software Architecture http://www.haefelinger.it +31 648 27 61 59 - To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org
Re: How to manage properties for identical tasks/macros run in parallel?
Any ideas anyone ? Thanks in advance, Parag Doke Save paper, save trees. Do not print emails/documents unless absolutely necessary. On Mon, Mar 7, 2011 at 12:52 PM, Parag Doke wrote: > Hello ant users. > I am facing an issue with handling properties with calls to tasks/macros > nested within the parallel task. More of a logical/approach related issue > rather than anything with the tool itself. Here go the details: > Using ant: > Apache Ant version 1.8.1 compiled on April 30 2010 > With Java: > java version "1.6.0_22" > Java(TM) SE Runtime Environment (build 1.6.0_22-b04) > Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing) > The most relevant part of the build.xml: > > > > > > > mySleep is my own macro with the following declaration: > > > > > > Now working with ${myProp} > > > Since properties are immutable, if it so happens that the 4th macro call > sets the property, the rest of them cannot modify it. A quick alternative to > this might be using the variable task (in place of property) from > ant-contrib.sf.net. However, the above is just an example. In reality, my > macro does an exec call. The outputproperty attribute to the exec call will > be what I need to process later. > So I guess my questions are: > 1) What is the best approach to handle properties/variables for (almost) > identical macro calls ? I cannot modify the property name each time. I could > redirect stdout/stderr of the exec task to some file. But not sure how to > guarantee that the file will be unique and not get overwritten if 2 tasks > finish at the same instant of time. > 2) Can the outputproperty value be captured in a variable directly ? I read > that it is possible to use the ant-contrib propertycopy task to get one > property value into another. But then there is a risk that the copy might > not be synchronized ... > The last option I have is of course to get rid of the parallel task and let > the macros run one after the other. But that would be modifying the > requirement to suit the scripting limitation I've run into. So I thought of > asking here before jumping on any implementation. > Thanks in advance for any pointers, > Parag Doke > Save paper, save trees. Do not print emails/documents unless absolutely > necessary. > - To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org
Re: How to manage properties for identical tasks/macros run in parallel?
You should see the task, whereby you can set up scoped property "shadowing." Matt On Sat, Mar 12, 2011 at 10:59 PM, Parag Doke wrote: > Any ideas anyone ? > Thanks in advance, > Parag Doke > Save paper, save trees. Do not print emails/documents unless > absolutely necessary. > > > > On Mon, Mar 7, 2011 at 12:52 PM, Parag Doke > wrote: >> Hello ant users. >> I am facing an issue with handling properties with calls to tasks/macros >> nested within the parallel task. More of a logical/approach related issue >> rather than anything with the tool itself. Here go the details: >> Using ant: >> Apache Ant version 1.8.1 compiled on April 30 2010 >> With Java: >> java version "1.6.0_22" >> Java(TM) SE Runtime Environment (build 1.6.0_22-b04) >> Java HotSpot(TM) Client VM (build 17.1-b03, mixed mode, sharing) >> The most relevant part of the build.xml: >> >> >> >> >> >> >> mySleep is my own macro with the following declaration: >> >> >> >> >> >> Now working with ${myProp} >> >> >> Since properties are immutable, if it so happens that the 4th macro call >> sets the property, the rest of them cannot modify it. A quick alternative to >> this might be using the variable task (in place of property) from >> ant-contrib.sf.net. However, the above is just an example. In reality, my >> macro does an exec call. The outputproperty attribute to the exec call will >> be what I need to process later. >> So I guess my questions are: >> 1) What is the best approach to handle properties/variables for (almost) >> identical macro calls ? I cannot modify the property name each time. I could >> redirect stdout/stderr of the exec task to some file. But not sure how to >> guarantee that the file will be unique and not get overwritten if 2 tasks >> finish at the same instant of time. >> 2) Can the outputproperty value be captured in a variable directly ? I read >> that it is possible to use the ant-contrib propertycopy task to get one >> property value into another. But then there is a risk that the copy might >> not be synchronized ... >> The last option I have is of course to get rid of the parallel task and let >> the macros run one after the other. But that would be modifying the >> requirement to suit the scripting limitation I've run into. So I thought of >> asking here before jumping on any implementation. >> Thanks in advance for any pointers, >> Parag Doke >> Save paper, save trees. Do not print emails/documents unless absolutely >> necessary. >> > > - > To unsubscribe, e-mail: user-unsubscr...@ant.apache.org > For additional commands, e-mail: user-h...@ant.apache.org > > - To unsubscribe, e-mail: user-unsubscr...@ant.apache.org For additional commands, e-mail: user-h...@ant.apache.org