title: Replace property in a xml file using ANT
body: <p>I'm trying to replace a version number in a build.xml file using an ANT script.</p>
  
  <p>I've tried various approaches, searched and re-searched StackOverflow for answers but could not get the exact query.</p>
  
  <p>so here is my xml file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;?eclipse version="3.0"?&gt;
  
  &lt;project name="feature" default="main" basedir="."&gt;
  &lt;target name="init"&gt;    
      &lt;property name="Version" value="1.0.0.20120327"/&gt;
  &lt;/target&gt;
  
      &lt;target name="main" depends="init"&gt;
      &lt;description&gt;Main target&lt;/description&gt;
  &lt;/target&gt;
  &lt;/project&gt;
  </code></pre>
  
  <p>Now as u can see the Version has yesterday's date. I need to replace it with the current date.</p>
  
  <p>Here is what I've tried:</p>
  
  <pre><code>&lt;target name="replace"&gt;
      &lt;tstamp &gt;
      &lt;format property="touch.time" pattern="yyyyMMdd"/&gt;  
      &lt;/tstamp&gt;   
  
  &lt;property name="Feature.dir" location="../feature" /&gt;
  
  &lt;!--Didnt Work--&gt;       
   &lt;copy file="${Feature.dir}\build.xml" tofile="${Feature.dir}\build1.xml"
  filtering="yes" overwrite="yes"&gt;
  &lt;filterset&gt;
      &lt;filter token="Version" value="1.0.0.${touch.time}"/&gt;
  &lt;/filterset&gt;
    &lt;/copy&gt;
  
    &lt;!--Didnt work
  
     &lt;replacetoken&gt;&lt;![CDATA[&lt;property name="Version" value=""/&gt;]]&gt;  
     &lt;/replacetoken&gt;  
     &lt;replacevalue&gt;&lt;![CDATA[&lt;property name="Version"value="1.0.0.${touchtime}" /&gt;]]&gt;
     &lt;/replacevalue&gt;
  
     --&gt;  
  
  
  &lt;!-- Didnt work 
      &lt;copy file="${Feature.dir}/build.xml" tofile="${Feature.dir}/build1.xml" &gt;
          &lt;filterchain&gt;
          &lt;tokenfilter&gt;
                  &lt;replaceregex pattern="^[ \t]*Version[ \t]*=.*$"
                                replace="Version=1.0.0.${touch.time}"/&gt;
          &lt;/tokenfilter&gt;
              &lt;/filterchain&gt;
  &lt;/copy&gt;
  --&gt;
  &lt;/target&gt;
  </code></pre>