use of org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog in project webtools.sourceediting by eclipse.
the class TestCatalogRetrivalAndModelCreation method testCatalog11RewriteUri.
public void testCatalog11RewriteUri() throws MalformedURLException, IOException {
ICatalog xmlCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
IRewriteEntry uriSuffix = (IRewriteEntry) xmlCatalog.createCatalogElement(IRewriteEntry.REWRITE_TYPE_URI);
uriSuffix.setStartString("urn:fisk:");
uriSuffix.setRewritePrefix(LOCAL_SCHEMA_DIR);
xmlCatalog.addCatalogElement(uriSuffix);
try {
String resolved = xmlCatalog.resolveURI("urn:fisk:example.dtd");
assertEquals(LOCAL_SCHEMA_DIR_REWRITTEN, resolved);
} finally {
xmlCatalog.removeCatalogElement(uriSuffix);
}
}
use of org.eclipse.wst.xml.core.internal.catalog.provisional.ICatalog in project webtools.sourceediting by eclipse.
the class AbstractCatalogTest method initCatalogs.
public void initCatalogs() {
defaultCatalog = XMLCorePlugin.getDefault().getDefaultXMLCatalog();
INextCatalog[] nextCatalogs = defaultCatalog.getNextCatalogs();
for (int i = 0; i < nextCatalogs.length; i++) {
INextCatalog catalog = nextCatalogs[i];
ICatalog referencedCatalog = catalog.getReferencedCatalog();
if (referencedCatalog != null) {
if (XMLCorePlugin.SYSTEM_CATALOG_ID.equals(referencedCatalog.getId())) {
systemCatalog = referencedCatalog;
} else if (XMLCorePlugin.USER_CATALOG_ID.equals(referencedCatalog.getId())) {
userCatalog = referencedCatalog;
}
}
}
}
Aggregations