diff --git a/src/main/org/apache/tools/ant/types/XMLCatalog.java b/src/main/org/apache/tools/ant/types/XMLCatalog.java index 6316f37a3..23286f174 100644 --- a/src/main/org/apache/tools/ant/types/XMLCatalog.java +++ b/src/main/org/apache/tools/ant/types/XMLCatalog.java @@ -83,8 +83,8 @@ import org.apache.tools.ant.util.FileUtils; *

* The object implemention sometask must provide a method called * createCatalog which returns an instance of - * XCatalog. Nested dtd and entity definitions are handled by - * the XCatalog object and must be labeled dtd and + * XMLCatalog. Nested DTD and entity definitions are handled by + * the XMLCatalog object and must be labeled dtd and * entity respectively.

* *

Possible future extension could allow a catalog file instead of nested @@ -154,6 +154,24 @@ public class XMLCatalog extends DataType implements Cloneable, EntityResolver { addDTD(dtd); } + /** + * Loads a nested XMLCatalog into our definition + * + * @param catalog Nested XMLCatalog + */ + public void addConfiguredXMLCatalog(XMLCatalog catalog) { + if (isReference()) { + throw noChildrenAllowed(); + } + + Vector newElements = catalog.getElements(); + Vector ourElements = getElements(); + Enumeration enum = newElements.elements(); + while (enum.hasMoreElements()) { + ourElements.add(enum.nextElement()); + } + } + /** * Makes this instance in effect a reference to another XCatalog instance. *