< prev index next >

src/java.xml/share/classes/com/sun/org/apache/xalan/internal/xsltc/trax/TransformerFactoryImpl.java

Print this page

        

*** 49,62 **** import java.util.Properties; import java.util.Vector; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import javax.xml.XMLConstants; import javax.xml.catalog.CatalogFeatures; import javax.xml.catalog.CatalogFeatures.Feature; import javax.xml.catalog.CatalogManager; ! import javax.xml.catalog.CatalogUriResolver; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import javax.xml.transform.ErrorListener; import javax.xml.transform.Source; import javax.xml.transform.Templates; --- 49,63 ---- import java.util.Properties; import java.util.Vector; import java.util.zip.ZipEntry; import java.util.zip.ZipFile; import javax.xml.XMLConstants; + import javax.xml.catalog.CatalogException; import javax.xml.catalog.CatalogFeatures; import javax.xml.catalog.CatalogFeatures.Feature; import javax.xml.catalog.CatalogManager; ! import javax.xml.catalog.CatalogResolver; import javax.xml.parsers.SAXParser; import javax.xml.parsers.SAXParserFactory; import javax.xml.transform.ErrorListener; import javax.xml.transform.Source; import javax.xml.transform.Templates;
*** 239,249 **** // Unmodifiable view of external extension function from xslt compiler // It will be populated by user-specified extension functions during the // type checking private Map<String, Class> _xsltcExtensionFunctions; ! CatalogUriResolver _catalogUriResolver; CatalogFeatures _catalogFeatures; CatalogFeatures.Builder cfBuilder = CatalogFeatures.builder(); // Catalog features String _catalogFiles = null; String _catalogDefer = null; --- 240,250 ---- // Unmodifiable view of external extension function from xslt compiler // It will be populated by user-specified extension functions during the // type checking private Map<String, Class> _xsltcExtensionFunctions; ! CatalogResolver _catalogUriResolver; CatalogFeatures _catalogFeatures; CatalogFeatures.Builder cfBuilder = CatalogFeatures.builder(); // Catalog features String _catalogFiles = null; String _catalogDefer = null;
*** 632,642 **** ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME); throw new NullPointerException(err.toString()); } // Inefficient, but array is small ! for (int i = 0; i < features.length; i++) { if (name.equals(features[i])) { return true; } } --- 633,643 ---- ErrorMsg err = new ErrorMsg(ErrorMsg.JAXP_GET_FEATURE_NULL_NAME); throw new NullPointerException(err.toString()); } // Inefficient, but array is small ! for (int i =0; i < features.length; i++) { if (name.equals(features[i])) { return true; } }
*** 1325,1335 **** source = _uriResolver.resolve(href, context); } if (source == null && _catalogFiles != null && _xmlFeatures.getFeature(JdkXmlFeatures.XmlFeature.USE_CATALOG)) { if (_catalogUriResolver == null) { ! _catalogUriResolver = CatalogManager.catalogUriResolver(_catalogFeatures); } source = _catalogUriResolver.resolve(href, context); } if (source != null) { return Util.getInputSource(xsltc, source); --- 1326,1336 ---- source = _uriResolver.resolve(href, context); } if (source == null && _catalogFiles != null && _xmlFeatures.getFeature(JdkXmlFeatures.XmlFeature.USE_CATALOG)) { if (_catalogUriResolver == null) { ! _catalogUriResolver = CatalogManager.catalogResolver(_catalogFeatures); } source = _catalogUriResolver.resolve(href, context); } if (source != null) { return Util.getInputSource(xsltc, source);
*** 1338,1347 **** --- 1339,1352 ---- catch (TransformerException e) { // should catch it when the resolver explicitly throws the exception final ErrorMsg msg = new ErrorMsg(ErrorMsg.INVALID_URI_ERR, href + "\n" + e.getMessage(), this); xsltc.getParser().reportError(Constants.FATAL, msg); } + catch (CatalogException e) { + final ErrorMsg msg = new ErrorMsg(ErrorMsg.CATALOG_EXCEPTION, href + "\n" + e.getMessage(), this); + xsltc.getParser().reportError(Constants.FATAL, msg); + } return null; } /**
< prev index next >