PREFER property set from Catalog API is taking precedence over the one set from catalog file.
The following code throws CatalogException:
CatalogFeatures features = CatalogFeatures.builder().with(CatalogFeatures.Feature.PREFER, "system").build();
Catalog catalog = CatalogManager.catalog(features, RESOURCES + "catalog_file_precedence.xml");
CatalogResolver catalogResolver = CatalogManager.catalogResolver(catalog);
catalogResolver.resolveEntity("-//FOO//DTD XML Dummy V0.0//EN", "http://www.oracle.com/alt1sys.dtd").getSystemId();
for the following catalog xml:
<catalog prefer="public" xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<public publicId="-//FOO//DTD XML Dummy V0.0//EN"
uri="dummy.dtd"/>
</catalog>
The following code throws CatalogException:
CatalogFeatures features = CatalogFeatures.builder().with(CatalogFeatures.Feature.PREFER, "system").build();
Catalog catalog = CatalogManager.catalog(features, RESOURCES + "catalog_file_precedence.xml");
CatalogResolver catalogResolver = CatalogManager.catalogResolver(catalog);
catalogResolver.resolveEntity("-//FOO//DTD XML Dummy V0.0//EN", "http://www.oracle.com/alt1sys.dtd").getSystemId();
for the following catalog xml:
<catalog prefer="public" xmlns="urn:oasis:names:tc:entity:xmlns:xml:catalog">
<public publicId="-//FOO//DTD XML Dummy V0.0//EN"
uri="dummy.dtd"/>
</catalog>