Skip to content

Commit 86266f4

Browse files
committed
Searched entities on system catalog as last resort
1 parent e2a5901 commit 86266f4

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

lib/xmljava.jar

80 Bytes
Binary file not shown.

src/com/maxprograms/xml/Catalog.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import java.net.URI;
2121
import java.net.URISyntaxException;
2222
import java.text.MessageFormat;
23+
import java.util.Collection;
2324
import java.util.Hashtable;
2425
import java.util.Iterator;
2526
import java.util.List;
@@ -261,7 +262,6 @@ private List<String[]> getUriRewrites() {
261262
return uriRewrites;
262263
}
263264

264-
@SuppressWarnings("resource")
265265
@Override
266266
public InputSource resolveEntity(String publicId, String systemId) throws SAXException, IOException {
267267
if (publicId != null) {
@@ -333,6 +333,14 @@ public InputSource resolveEntity(String name, String publicId, String baseURI, S
333333
if (dtdSystemEntities != null && systemId != null && dtdSystemEntities.containsKey(systemId)) {
334334
return new InputSource(new FileInputStream(dtdSystemEntities.get(systemId)));
335335
}
336+
Collection<String> values = systemCatalog.values();
337+
Iterator<String> it = values.iterator();
338+
while (it.hasNext()) {
339+
String value = it.next();
340+
if (value.endsWith(systemId)) {
341+
return new InputSource(new FileInputStream(value));
342+
}
343+
}
336344
return null;
337345
}
338346

src/com/maxprograms/xml/Constants.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
public class Constants {
1616

1717
public static final String VERSION = "2.1.1";
18-
public static final String BUILD = "20250217_1831";
18+
public static final String BUILD = "20250221_1014";
1919

2020
private Constants() {
2121
// private for security

0 commit comments

Comments
 (0)