IDEA-229461 Help Resolving XML Catalog URIs

support uri resolve

GitOrigin-RevId: 18a655296ab46efc965c4f6682eb03b49df2e6c3
This commit is contained in:
Dmitry Avdeev
2019-12-23 10:02:44 +00:00
committed by intellij-monorepo-bot
parent 9aba3bf6bd
commit e85ea16993
3 changed files with 9 additions and 0 deletions
@@ -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<HighlightInfo> infos = myFixture.doHighlighting();
+1
View File
@@ -8,4 +8,5 @@
uri="xhtml1-strict.dtd"/>
<system systemId="urn:oasis:names:tc:xacml:1.0:policy"
uri="catalog/cs-xacml-schema-policy-01.xsd"/>
<uriSuffix uriSuffix="test-node.xsl" uri="file:///C:/temp/catalog-test/library/test-node.xsl"/>
</catalog>
@@ -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;
}