diff --git a/docs/manual/CoreTypes/xmlcatalog.html b/docs/manual/CoreTypes/xmlcatalog.html index 83f2041e9..3ad445d3b 100644 --- a/docs/manual/CoreTypes/xmlcatalog.html +++ b/docs/manual/CoreTypes/xmlcatalog.html @@ -84,8 +84,8 @@ href="http://oasis-open.org/committees/entity/background/9401.html"> plain text format or XML format. If the xml-commons resolver library is not found in the -classpath, external catalog files, specified in catalogpath (or -the deprecated catalogfiles) , will be ignored and a warning +classpath, external catalog files, specified in catalogpath, +will be ignored and a warning will be logged. In this case, however, processing of inline entries will proceed normally.

Currently, only <dtd> and @@ -221,13 +221,6 @@ XML format. Entries specifying nonexistent files will be ignored. If the resolver library from xml-commons is not available in the classpath, all catalogpaths will be ignored and a warning will be logged.

-

catalogfiles (deprecated)

-

-The nested catalogfiles element specifies a FileSet. This is equivalent to -specifying a <fileset> inside a catalogpath, -and is retained for backwards-compatibility. -

Examples

Set up an XMLCatalog with a single dtd referenced locally in a user's home diff --git a/src/etc/testcases/taskdefs/optional/xmlvalidate.xml b/src/etc/testcases/taskdefs/optional/xmlvalidate.xml index 018022a76..76c26fcce 100644 --- a/src/etc/testcases/taskdefs/optional/xmlvalidate.xml +++ b/src/etc/testcases/taskdefs/optional/xmlvalidate.xml @@ -44,7 +44,9 @@ - + + + @@ -68,7 +70,9 @@ - + + + diff --git a/src/main/org/apache/tools/ant/types/XMLCatalog.java b/src/main/org/apache/tools/ant/types/XMLCatalog.java index 73dc9bff6..1a7e6c720 100644 --- a/src/main/org/apache/tools/ant/types/XMLCatalog.java +++ b/src/main/org/apache/tools/ant/types/XMLCatalog.java @@ -104,13 +104,9 @@ import org.xml.sax.XMLReader; * href="http://www.oasis-open.org/committees/entity/spec-2001-08-06.html"> * XML format. If the xml-commons resolver library is not found * in the classpath, external catalog files, specified in - * <catalogfiles> filesets and * <catalogpath> paths, will be ignored and a warning will * be logged. In this case, however, processing of inline entries will proceed * normally.

- *

Note that, as <catalogpath> can contain nested - * filesets, it is more general than <catalogfiles>, which - * should be considered deprecated.

* *

Currently, only <dtd> and * <entity> elements may be specified inline; these @@ -168,7 +164,7 @@ public class XMLCatalog extends DataType //-- Fields ---------------------------------------------------------------- - /** Holds dtd/entity objects and catalog filesets until needed. */ + /** Holds dtd/entity objects until needed. */ private Vector elements = new Vector(); /** @@ -196,11 +192,9 @@ public class XMLCatalog extends DataType } /** - * Returns the elements of the catalog - ResourceLocation and FileSet - * objects. + * Returns the elements of the catalog - ResourceLocation objects. * - * @return the elements of the catalog - ResourceLocation and FileSet - * objects + * @return the elements of the catalog - ResourceLocation objects */ private Vector getElements() { return elements; @@ -216,12 +210,12 @@ public class XMLCatalog extends DataType } /** - * Set the list of ResourceLocation objects and FileSets in the catalog. + * Set the list of ResourceLocation objects in the catalog. * Not allowed if this catalog is itself a reference to another catalog -- * that is, a catalog cannot both refer to another and contain * elements or other attributes. * - * @param aVector the new list of ResourceLocations and FileSets + * @param aVector the new list of ResourceLocations * to use in the catalog. */ private void setElements(Vector aVector) { @@ -280,30 +274,11 @@ public class XMLCatalog extends DataType setChecked( false ); } - /** - * Creates the nested <catalogfiles> element. - * Not allowed if this catalog is itself a reference to another - * catalog -- that is, a catalog cannot both refer to another - * and contain elements or other attributes. - * - * @param fs the fileset of external catalogs. - * @exception BuildException - * if this is a reference and no nested elements are allowed. - */ - public void addCatalogfiles(FileSet fs) throws BuildException { - if (isReference()) { - throw noChildrenAllowed(); - } - getElements().addElement(fs); - } - - /** Creates a nested <catalogpath> element. * Not allowed if this catalog is itself a reference to another * catalog -- that is, a catalog cannot both refer to another * and contain elements or other attributes. * - * @param fs the fileset of external catalogs. * @exception BuildException * if this is a reference and no nested elements are allowed. */ @@ -559,19 +534,6 @@ public class XMLCatalog extends DataType // available, so we can't use it. // catalogResolver = new InternalResolver(); - // - // If any are specified, warn that they - // will be ignored. - // - Enumeration enum = getElements().elements(); - while (enum.hasMoreElements()) { - Object o = enum.nextElement(); - if (o instanceof FileSet) { - log("Warning: External catalogfiles will be ignored", - Project.MSG_WARN); - break; - } - } if (getCatalogPath() != null && getCatalogPath().list().length != 0) { log("Warning: catalogpath listing external catalogs"+ @@ -1125,7 +1087,7 @@ public class XMLCatalog extends DataType /** * Process each external catalog file specified in a - * <catalogfiles> FileSet. It will be + * <catalogpath>. It will be * parsed by the resolver library, and the individual elements * will be added back to us (that is, the controlling * XMLCatalog instance) via a callback mechanism. @@ -1143,29 +1105,6 @@ public class XMLCatalog extends DataType throw new BuildException(ex); } - // Parse each catalog listed in nested elements. - Enumeration enum = getElements().elements(); - while (enum.hasMoreElements()) { - Object o = enum.nextElement(); - if (o instanceof FileSet) { - FileSet fs = (FileSet)o; - DirectoryScanner ds = - fs.getDirectoryScanner(getProject()); - String[] files = ds.getIncludedFiles(); - for (int i = 0; i < files.length; i++) { - File catFile = new File(ds.getBasedir(), files[i]); - try { - parseCatalog.invoke(resolverImpl, - new Object[] - { catFile.getPath() }); - } - catch (Exception ex) { - throw new BuildException(ex); - } - } - } - } - // Parse each catalog listed in nested elements Path catPath = getCatalogPath(); if (catPath != null) {