diff --git a/xml/tests/src/com/intellij/xml/XMLCatalogManagerTest.java b/xml/tests/src/com/intellij/xml/XMLCatalogManagerTest.java index 16b268692169..2312b7b2522f 100644 --- a/xml/tests/src/com/intellij/xml/XMLCatalogManagerTest.java +++ b/xml/tests/src/com/intellij/xml/XMLCatalogManagerTest.java @@ -55,6 +55,12 @@ public class XMLCatalogManagerTest extends BasePlatformTestCase { assertTrue(resolve, resolve.endsWith("/catalog/xhtml1-strict.dtd")); } + public void testResolveUri() { + String resolve = getManager().resolve("test-node.xsl"); + assertNotNull(resolve); + assertEquals("file:/C:/temp/catalog-test/library/test-node.xsl", resolve); + } + public void testHighlighting() { myFixture.configureByFile("policy.xml"); List infos = myFixture.doHighlighting(); diff --git a/xml/tests/testData/catalog/catalog.xml b/xml/tests/testData/catalog/catalog.xml index 1e97c2c0decd..e945c13bab51 100644 --- a/xml/tests/testData/catalog/catalog.xml +++ b/xml/tests/testData/catalog/catalog.xml @@ -8,4 +8,5 @@ uri="xhtml1-strict.dtd"/> + \ No newline at end of file diff --git a/xml/xml-psi-impl/src/com/intellij/javaee/XMLCatalogManager.java b/xml/xml-psi-impl/src/com/intellij/javaee/XMLCatalogManager.java index 638da8a9acf6..3021bb048ad3 100644 --- a/xml/xml-psi-impl/src/com/intellij/javaee/XMLCatalogManager.java +++ b/xml/xml-psi-impl/src/com/intellij/javaee/XMLCatalogManager.java @@ -75,6 +75,8 @@ public class XMLCatalogManager { try { Catalog catalog = myManager.getCatalog(); if (catalog == null) return null; + String byUri = catalog.resolveURI(uri); + if (byUri != null) return byUri; String resolved = catalog.resolveSystem(uri); return resolved == null ? catalog.resolvePublic(uri, null) : resolved; }