public static DocumentBuilder borrowDocumentBuilder() throws Exception { return (DocumentBuilder) DOCUMENT_BUILDERS.borrowObject(); }
/** * Convenience method to get a new instance of a TransformerFactory. * If the {@link TransformerFactory} is an instance of * net.sf.saxon.TransformerFactoryImpl, the attribute * {@link net.sf.saxon.FeatureKeys#VERSION_WARNING} will be set to false in order to * suppress the warning about using an XSLT1 stylesheet with an XSLT2 * processor. * * @return a new instance of TransformerFactory * @throws Exception */ public static TransformerFactory borrowTransformerFactory() throws Exception { return (TransformerFactory) TRANSFORM_FACTORIES.borrowObject(); }
/** * Convenience method to get a new instance of a TransformerFactory. * If the {@link TransformerFactory} is an instance of * net.sf.saxon.TransformerFactoryImpl, the attribute * {@link net.sf.saxon.FeatureKeys#VERSION_WARNING} will be set to false in order to * suppress the warning about using an XSLT1 stylesheet with an XSLT2 * processor. * * @return a new instance of TransformerFactory * @throws Exception */ public static TransformerFactory borrowTransformerFactory() throws Exception { return (TransformerFactory) TRANSFORM_FACTORIES.borrowObject(); }
public static DocumentBuilder borrowDocumentBuilder() throws Exception { return (DocumentBuilder) DOCUMENT_BUILDERS.borrowObject(); }
public static Document parseNamespaceAware(InputStream src) throws Exception { Document result = null; DocumentBuilder builder = (DocumentBuilder) DOCUMENT_BUILDERS.borrowObject(); try { result = builder.parse(src); } finally { DOCUMENT_BUILDERS.returnObject(builder); } return result; }
public static Document parseNamespaceAware(InputStream src) throws Exception { Document result = null; DocumentBuilder builder = (DocumentBuilder) DOCUMENT_BUILDERS.borrowObject(); try { result = builder.parse(src); } finally { DOCUMENT_BUILDERS.returnObject(builder); } return result; }
public static Transformer getTransformer(Source src) throws Exception { TransformerFactory factory = null; Transformer result = null; try { factory = TRANSFORM_FACTORIES.borrowObject(); result = (src == null) ? factory.newTransformer() : factory.newTransformer(src); } finally { if (factory != null) { try { TRANSFORM_FACTORIES.returnObject(factory); } catch (Exception e) { e.printStackTrace(); } } } return result; }
public static Transformer getTransformer(Source src) throws Exception { TransformerFactory factory = null; Transformer result = null; try { factory = TRANSFORM_FACTORIES.borrowObject(); result = (src == null) ? factory.newTransformer() : factory.newTransformer(src); } finally { if (factory != null) { try { TRANSFORM_FACTORIES.returnObject(factory); } catch (Exception e) { e.printStackTrace(); } } } return result; }
public static void parseWithoutValidating(InputSource in, DefaultHandler handler) throws SAXException, IOException { SAXParser parser = null; try { parser = (SAXParser) SAX_PARSERS.borrowObject(); } catch (Exception e) { throw new RuntimeException("Error initializing SAX parser", e); } try { parser.parse(in, handler); } finally { if (parser != null) { try { SAX_PARSERS.returnObject(parser); } catch (Exception e) { e.printStackTrace(); } } } } }
public static void parseWithoutValidating(InputSource in, DefaultHandler handler) throws SAXException, IOException { SAXParser parser = null; try { parser = (SAXParser) SAX_PARSERS.borrowObject(); } catch (Exception e) { throw new RuntimeException("Error initializing SAX parser", e); } try { parser.parse(in, handler); } finally { if (parser != null) { try { SAX_PARSERS.returnObject(parser); } catch (Exception e) { e.printStackTrace(); } } } } }
validator = m_validators.borrowObject(); validator.validate(new DOMSource(doc)); } catch (Exception e) {
validator = m_validators.borrowObject(); validator.validate(new DOMSource(doc)); } catch (Exception e) {