diff -Nru xml-commons-resolver-1.2/resolver.xml xml-commons-resolver-1.2-gil/resolver.xml
--- xml-commons-resolver-1.2/resolver.xml 2006-11-20 21:23:07.000000000 +0100
+++ xml-commons-resolver-1.2-gil/resolver.xml 2009-12-17 13:23:14.000000000 +0100
@@ -88,7 +88,7 @@
-
+
diff -Nru xml-commons-resolver-1.2/src/org/apache/xml/resolver/Catalog.java xml-commons-resolver-1.2-gil/src/org/apache/xml/resolver/Catalog.java
--- xml-commons-resolver-1.2/src/org/apache/xml/resolver/Catalog.java 2006-11-20 21:23:06.000000000 +0100
+++ xml-commons-resolver-1.2-gil/src/org/apache/xml/resolver/Catalog.java 2009-12-17 13:23:14.000000000 +0100
@@ -27,6 +27,7 @@
import java.io.DataInputStream;
import java.util.Enumeration;
+import java.util.Iterator;
import java.util.Hashtable;
import java.util.Vector;
@@ -1166,6 +1167,22 @@
}
}
+ /**
+ * Return all registered public IDs.
+ */
+ public Iterator getPublicIDs() {
+ Vector v = new Vector();
+ Enumeration enum = catalogEntries.elements();
+
+ while (enum.hasMoreElements()) {
+ CatalogEntry e = (CatalogEntry) enum.nextElement();
+ if (e.getEntryType() == PUBLIC) {
+ v.add(e.getEntryArg(0));
+ }
+ }
+ return v.iterator();
+ }
+
/**
* Return the applicable DOCTYPE system identifier.
diff -Nru xml-commons-resolver-1.2/src/org/apache/xml/resolver/CatalogManager.java xml-commons-resolver-1.2-gil/src/org/apache/xml/resolver/CatalogManager.java
--- xml-commons-resolver-1.2/src/org/apache/xml/resolver/CatalogManager.java 2006-11-20 21:23:06.000000000 +0100
+++ xml-commons-resolver-1.2-gil/src/org/apache/xml/resolver/CatalogManager.java 2009-12-17 13:23:14.000000000 +0100
@@ -212,7 +212,11 @@
// to avoid it.
}
- /** Constructor that specifies an explicit property file. */
+ /**
+ * Constructor that specifies an explicit property file.
+ * @param propertyFile path to poperty file (e.g. com/resources/CatalogManager).
+ * null
means that no property file is consulted at all.
+ */
public CatalogManager(String propertyFile) {
this.propertyFile = propertyFile;
@@ -239,13 +243,14 @@
* resources from it.
*/
private synchronized void readProperties() {
+ if (propertyFile == null) return;
try {
propertyFileURI = CatalogManager.class.getResource("/"+propertyFile);
InputStream in =
CatalogManager.class.getResourceAsStream("/"+propertyFile);
if (in==null) {
if (!ignoreMissingProperties) {
- System.err.println("Cannot find "+propertyFile);
+ debug.message(2, "Cannot find "+propertyFile);
// there's no reason to give this warning more than once
ignoreMissingProperties = true;
}
diff -Nru xml-commons-resolver-1.2/src/org/apache/xml/resolver/tools/CatalogResolver.java xml-commons-resolver-1.2-gil/src/org/apache/xml/resolver/tools/CatalogResolver.java
--- xml-commons-resolver-1.2/src/org/apache/xml/resolver/tools/CatalogResolver.java 2006-11-20 21:23:06.000000000 +0100
+++ xml-commons-resolver-1.2-gil/src/org/apache/xml/resolver/tools/CatalogResolver.java 2009-12-17 13:23:14.000000000 +0100
@@ -192,33 +192,9 @@
String resolved = getResolvedEntity(publicId, systemId);
if (resolved != null) {
- try {
InputSource iSource = new InputSource(resolved);
iSource.setPublicId(publicId);
-
- // Ideally this method would not attempt to open the
- // InputStream, but there is a bug (in Xerces, at least)
- // that causes the parser to mistakenly open the wrong
- // system identifier if the returned InputSource does
- // not have a byteStream.
- //
- // It could be argued that we still shouldn't do this here,
- // but since the purpose of calling the entityResolver is
- // almost certainly to open the input stream, it seems to
- // do little harm.
- //
- URL url = new URL(resolved);
- InputStream iStream = url.openStream();
- iSource.setByteStream(iStream);
-
return iSource;
- } catch (Exception e) {
- catalogManager.debug.message(1,
- "Failed to create InputSource ("
- + e.toString()
- + ")", resolved);
- return null;
- }
}
return null;