Example #1
0
 /**
  * Compile a {@link Templates} from a given stream. The template is not added to the pool
  * automatically.
  */
 public Templates compileTemplate(InputStream stream) throws SAXException {
   final StreamSource source = new StreamSource(stream);
   try {
     return tFactory.newTemplates(source);
   } catch (Exception e) {
     throw new SAXException("Could not compile stylesheet.", e);
   }
 }
Example #2
0
 /**
  * Compile a {@link Templates} from a given system identifier. The template is not added to the
  * pool, a manual call to {@link #addTemplate(String, Templates)} is required.
  */
 public Templates compileTemplate(String systemId) throws SAXException {
   final StreamSource source = new StreamSource(systemId);
   try {
     return tFactory.newTemplates(source);
   } catch (Exception e) {
     throw new SAXException("Could not compile stylesheet: " + systemId, e);
   }
 }
Example #3
0
 /** @return returns the identity transformer handler. */
 public TransformerHandler getIdentityTransformerHandler()
     throws TransformerConfigurationException {
   return tFactory.newTransformerHandler();
 }