title: DTD not found error while updating attribute value using Ant XmlTask
body: <p>I want to update value of <code>debug.classpath</code> property. I am using <code>XmlTask</code> to do manipulations. However, I am running to <code>DTD</code> not found issue. </p>
  
  <p>This is my target XML file.<br/></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;!DOCTYPE Configuration SYSTEM "xconf.dtd"&gt;
  &lt;Configuration&gt;
       &lt;Property name="debug.classpath" value="&lt;changeme&gt;"
  &lt;/Configuration&gt;
  </code></pre>
  
  <p>This is my Ant target.</p>
  
  <pre><code>&lt;target name="configure" &gt;
        &lt;xmltask source="myxml.xml"&gt;
              &lt;attr path="//Property[@name='debug.classpath']" attr="value"  value="New Value"/&gt;
        &lt;/xmltask&gt;    
  &lt;/target&gt;
  </code></pre>
  
  <p>When I execute this target, I get below error.</p>
  
  <blockquote>
    <p>[xmltask] java.io.FileNotFoundException: D:\utils\xconf.dtd (The
    system cannot find the file specified)</p>
  </blockquote>
  
  <p>This DTD is present in a Jar file called <code>Utils.jar</code>. After google'ing I found <code>XmlCatalog</code> task and using that I wrote below version of my target.(Not sure if I've made intended use of <code>XmlCatalog</code>). The <code>Utils.jar</code> is not in Ant's classpath hence tried to add it using <code>&lt;classpath&gt;</code>. </p>
  
  <pre><code>&lt;target name="configure"&gt;
      &lt;xmlcatalog id="XconfDtd"&gt;
          &lt;classpath&gt;
              &lt;pathelement location="D:/libs/Utils.jar"/&gt;
          &lt;/classpath&gt;
          &lt;dtd location="xconf.dtd" /&gt;
      &lt;/xmlcatalog&gt;
      &lt;xmltask source="${env.WT_HOME}/codebase/wt.properties.xconf"&gt;
          &lt;xmlcatalog refid="XconfDtd" /&gt;
          &lt;attr path="//Property[@name='debug.classpath']" attr="value" value="New Value" /&gt;
      &lt;/xmltask&gt;
  &lt;/target&gt;
  </code></pre>
  
  <p>However, when I execute this target, I get below error</p>
  
  <blockquote>
    <p>[xmltask] java.lang.NullPointerException  [xmltask]     at
    org.apache.tools.ant.types.XMLCatalog.findMatchingEntry(XMLCatalog.java:592)
    [xmltask]     at
    org.apache.tools.ant.types.XMLCatalog.access$000(XMLCatalog.java:119) 
    [xmltask]     at
    org.apache.tools.ant.types.XMLCatalog$InternalResolver.resolveEntity(XMLCatalog.java:811)
    [xmltask]     at
    org.apache.tools.ant.types.XMLCatalog.resolveEntity(XMLCatalog.java:385)
    [xmltask]     at
    com.sun.org.apache.xerces.internal.util.EntityResolverWrapper.resolveEntity(EntityResolverWrapper.java:110)
    [xmltask]     at
    com.sun.org.apache.xerces.internal.impl.XMLEntityManager.resolveEntityAsPerStax(XMLEntityManager.java:994)
    [xmltask]     at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.dispatch(XMLDocumentScannerImpl.java:1149)
    [xmltask]     at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$DTDDriver.next(XMLDocumentScannerImpl.java:1047)
    [xmltask]     at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl$PrologDriver.next(XMLDocumentScannerImpl.java:960)
    [xmltask]     at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentScannerImpl.next(XMLDocumentScannerImpl.java:607)
    [xmltask]     at
    com.sun.org.apache.xerces.internal.impl.XMLNSDocumentScannerImpl.next(XMLNSDocumentScannerImpl.java:116)
    [xmltask]     at
    com.sun.org.apache.xerces.internal.impl.XMLDocumentFragmentScannerImpl.scanDocument(XMLDocumentFragmentScannerImpl.java:488)
    [xmltask]     at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:835)
    [xmltask]     at
    com.sun.org.apache.xerces.internal.parsers.XML11Configuration.parse(XML11Configuration.java:764)</p>
  </blockquote>
  
  <p>Even after putting <code>Utils.jar</code> to <code>$ANT_HOME/lib</code> I still see above error. Any help is highly appreciated. You can suggest any alternate way to achieve this in Ant.</p>
  
  <p>Thanks in advance.</p>