< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xerces/internal/xinclude/XIncludeHandler.java

Print this page

        

@@ -1,7 +1,7 @@
 /*
- * Copyright (c) 2016, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2006, 2016, Oracle and/or its affiliates. All rights reserved.
  */
 /*
  * Licensed to the Apache Software Foundation (ASF) under one or more
  * contributor license agreements.  See the NOTICE file distributed with
  * this work for additional information regarding copyright ownership.

@@ -73,11 +73,10 @@
 import java.util.Objects;
 import javax.xml.catalog.CatalogException;
 import javax.xml.catalog.CatalogFeatures;
 import javax.xml.catalog.CatalogManager;
 import javax.xml.catalog.CatalogResolver;
-import javax.xml.catalog.CatalogUriResolver;
 import javax.xml.transform.Source;
 import jdk.xml.internal.JdkXmlUtils;
 import org.xml.sax.InputSource;
 
 /**

@@ -369,11 +368,10 @@
 
     /** indicate whether Catalog should be used for resolving external resources */
     private boolean fUseCatalog = true;
     CatalogFeatures fCatalogFeatures;
     CatalogResolver fCatalogResolver;
-    CatalogUriResolver fCatalogUriResolver;
 
     private String fCatalogFile;
     private String fDefer;
     private String fPrefer;
     private String fResolve;

@@ -1636,14 +1634,14 @@
                            Although URI entry is preferred for resolving XInclude, system entry
                            is allowed as well.
                         */
                         Source source = null;
                         try {
-                            if (fCatalogUriResolver == null) {
-                                fCatalogUriResolver = CatalogManager.catalogUriResolver(fCatalogFeatures);
+                            if (fCatalogResolver == null) {
+                                fCatalogResolver = CatalogManager.catalogResolver(fCatalogFeatures);
                             }
-                            source = fCatalogUriResolver.resolve(href, fCurrentBaseURI.getExpandedSystemId());
+                            source = fCatalogResolver.resolve(href, fCurrentBaseURI.getExpandedSystemId());
                         } catch (CatalogException e) {}
 
                         if (source != null && !source.isEmpty()) {
                             includedSource = new XMLInputSource(null, source.getSystemId(),
                                     fCurrentBaseURI.getExpandedSystemId(), true);

@@ -1667,11 +1665,11 @@
 
                     includedSource = createInputSource(includedSource.getPublicId(), includedSource.getSystemId(),
                         includedSource.getBaseSystemId(), accept, acceptLanguage);
                 }
             }
-            catch (IOException e) {
+            catch (IOException | CatalogException e) {
                 reportResourceError(
                     "XMLResourceError",
                     new Object[] { href, e.getMessage()});
                 return false;
             }
< prev index next >