well formed != valid better debug support in ApacheCatalogResolver PRs: 24059, 24060, 24069, 24070, 24074 Submitted by: Jesse Glick <jglick at netbeans dot org> git-svn-id: https://svn.apache.org/repos/asf/ant/core/trunk@275565 13f79535-47bb-0310-9956-ffa450edef68master
@@ -50,7 +50,7 @@ | |||||
of ant for bulk project execution. | of ant for bulk project execution. | ||||
<strong>This task must no be used outside of a | <strong>This task must no be used outside of a | ||||
<code>target</code> if it invoces the same build file it is | |||||
<code>target</code> if it invokes the same build file it is | |||||
part of.</strong> | part of.</strong> | ||||
</p> | </p> | ||||
@@ -8,7 +8,7 @@ | |||||
<h2><a name="xmlproperty">XmlProperty</a></h2> | <h2><a name="xmlproperty">XmlProperty</a></h2> | ||||
<h3>Description</h3> | <h3>Description</h3> | ||||
<p> | <p> | ||||
Loads property values from a valid xml file. This XML property file: | |||||
Loads property values from a well-formed xml file. This XML property file: | |||||
<pre> | <pre> | ||||
<root> | <root> | ||||
<properties> | <properties> | ||||
@@ -16,7 +16,7 @@ Loads property values from a valid xml file. This XML property file: | |||||
</properties> | </properties> | ||||
</root> | </root> | ||||
</pre> | </pre> | ||||
is roughly equivalent to this java property file: | |||||
is roughly equivalent to this Java property file: | |||||
<pre> | <pre> | ||||
root.properties.foo = bar | root.properties.foo = bar | ||||
</pre> | </pre> | ||||
@@ -25,7 +25,7 @@ is roughly equivalent to this java property file: | |||||
By default, this load | By default, this load | ||||
does <em>no</em> processing of the input. In particular, unlike the | does <em>no</em> processing of the input. In particular, unlike the | ||||
<a href="property.html">Property task</a>, property references | <a href="property.html">Property task</a>, property references | ||||
(i.e., ${foo}) are not resolved. | |||||
(i.e., <samp>${foo}</samp>) are not resolved. | |||||
<p> | <p> | ||||
<a name="semanticAttributes"> | <a name="semanticAttributes"> | ||||
<h3>Semantic Attributes</h3> | <h3>Semantic Attributes</h3> | ||||
@@ -98,7 +98,7 @@ is roughly equivalent to the following fragments in a build.xml file: | |||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
<td valign="top">validate</td> | <td valign="top">validate</td> | ||||
<td valign="top">Validate the input file.</td> | |||||
<td valign="top">Validate the input file (e.g. by a DTD). Otherwise the XML must only be well-formed.</td> | |||||
<td valign="top" align="center">No, default is <i>false</i>.</td> | <td valign="top" align="center">No, default is <i>false</i>.</td> | ||||
</tr> | </tr> | ||||
<tr> | <tr> | ||||
@@ -250,11 +250,10 @@ is equivalent to the following entries in a build file: | |||||
</classpath> | </classpath> | ||||
</pre> | </pre> | ||||
<hr/> | |||||
<hr> | |||||
<p align="center">Copyright © 2002 Apache Software Foundation. All rights | |||||
<p align="center">Copyright © 2002-2003 Apache Software Foundation. All rights | |||||
Reserved.</p> | Reserved.</p> | ||||
</body> | </body> | ||||
</html> | </html> | ||||
@@ -21,7 +21,7 @@ is used, the zipfileset is populated with filesystem files found under <span | |||||
</li> | </li> | ||||
</ul> | </ul> | ||||
<p><code><zipfileset></code> supports all attributes of <code><<a | <p><code><zipfileset></code> supports all attributes of <code><<a | ||||
href="file:///C:/dev/gnu/ant/docs/manual/CoreTypes/fileset.html">fileset</a>></code> | |||||
href="fileset.html">fileset</a>></code> | |||||
in addition to those listed below.<br> | in addition to those listed below.<br> | ||||
</p> | </p> | ||||
<p>Since Ant 1.6, a zipfileset can be defined with the <span | <p>Since Ant 1.6, a zipfileset can be defined with the <span | ||||
@@ -1048,7 +1048,7 @@ documentation.</p> | |||||
<tr valign="top"> | <tr valign="top"> | ||||
<td nowrap><a href="CoreTasks/xmlproperty.html">XmlProperty</a></td> | <td nowrap><a href="CoreTasks/xmlproperty.html">XmlProperty</a></td> | ||||
<td><p>Loads property values from a valid XML file.</p></td> | |||||
<td><p>Loads property values from a well-formed XML file.</p></td> | |||||
</tr> | </tr> | ||||
</table> | </table> | ||||
@@ -80,7 +80,7 @@ import org.apache.tools.ant.util.LoaderUtils; | |||||
* class will then use this loader rather than the system class loader. | * class will then use this loader rather than the system class loader. | ||||
* | * | ||||
* @author Conor MacNeill | * @author Conor MacNeill | ||||
* @author <a href="mailto:Jesse.Glick@netbeans.com">Jesse Glick</a> | |||||
* @author <a href="mailto:jglick@netbeans.org">Jesse Glick</a> | |||||
* @author Magesh Umasankar | * @author Magesh Umasankar | ||||
*/ | */ | ||||
public class AntClassLoader extends ClassLoader implements BuildListener { | public class AntClassLoader extends ClassLoader implements BuildListener { | ||||
@@ -64,6 +64,7 @@ import org.apache.tools.ant.BuildException; | |||||
import org.apache.tools.ant.types.XMLCatalog; | import org.apache.tools.ant.types.XMLCatalog; | ||||
import org.apache.tools.ant.types.ResourceLocation; | import org.apache.tools.ant.types.ResourceLocation; | ||||
import org.apache.xml.resolver.Catalog; | |||||
import org.apache.xml.resolver.CatalogManager; | import org.apache.xml.resolver.CatalogManager; | ||||
import org.apache.xml.resolver.tools.CatalogResolver; | import org.apache.xml.resolver.tools.CatalogResolver; | ||||
@@ -124,7 +125,7 @@ public class ApacheCatalogResolver extends CatalogResolver { | |||||
CatalogManager.getStaticManager().setUseStaticCatalog(false); | CatalogManager.getStaticManager().setUseStaticCatalog(false); | ||||
// debug | // debug | ||||
// System.setProperty("xml.catalog.verbosity", "4"); | |||||
// CatalogManager.getStaticManager().setVerbosity(4); | |||||
} | } | ||||
/** Set the XMLCatalog object to callback. */ | /** Set the XMLCatalog object to callback. */ | ||||
@@ -138,7 +139,11 @@ public class ApacheCatalogResolver extends CatalogResolver { | |||||
*/ | */ | ||||
public void parseCatalog(String file) { | public void parseCatalog(String file) { | ||||
ApacheCatalog catalog = (ApacheCatalog) getCatalog(); | |||||
Catalog _catalog = getCatalog(); | |||||
if (!(_catalog instanceof ApacheCatalog)) { | |||||
throw new BuildException("Wrong catalog type found: " + _catalog.getClass().getName()); | |||||
} | |||||
ApacheCatalog catalog = (ApacheCatalog) _catalog; | |||||
// Pass in reference to ourselves so we can be called back. | // Pass in reference to ourselves so we can be called back. | ||||
catalog.setResolver(this); | catalog.setResolver(this); | ||||