Java 8 TemplatesHandler - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Java 8 TemplatesHandler class.

This code example shows how to use the following methods:getTemplates
This code example shows how to use the following methods:getTemplates, setSystemId
			saxParserFactory = SAXParserFactory.newInstance();
			saxParserFactory.setNamespaceAware(true);
		} 
		TemplatesHandler th = factory.newTemplatesHandler();
		String systemId = xsltresource.getSystemId();
		th.setSystemId(systemId);
		SAXParser parser = saxParserFactory.newSAXParser();
		XMLReader xr = parser.getXMLReader();
 
		xr.setContentHandler(th);
		xr.parse(xsltresource);
		templates = th.getTemplates();
	} 
 
	/** 
	 * get the output content handler, configured with the writer, ready for 
	 * pumping sax events into 
	 *  
	 * @param out 
	 *        the output stream 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getTemplates
      // Get an XMLReader. 
      if (reader == null) {
        reader = XMLReaderManager.getInstance().getXMLReader();
      } 
      TemplatesHandler templatesHandler = saxTFactory.newTemplatesHandler();
      reader.setContentHandler(templatesHandler);
 
      try { 
        reader.parse( getInputSource(xsl) );
      } catch (MalformedURLException e) {
        log.info("Xerces Version: " +  Version.getVersion());
        throw e;
      } 
      templates = templatesHandler.getTemplates();
 
      templateCache.put(xsl, templates);
    } 
 
    return templates;
  } 
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getTemplates
      // Create a ContentHandler to handle parsing of the stylesheet. 
      TemplatesHandler templatesHandler = saxTFactory.newTemplatesHandler();
 
      // Create an XMLReader and set its ContentHandler. 
      XMLReader reader = XMLReaderFactory.createXMLReader();
      reader.setContentHandler(templatesHandler);
     
      // Parse the stylesheet.                        
      reader.parse("birds.xsl");
 
      //Get the Templates object from the ContentHandler. 
      Templates templates = templatesHandler.getTemplates();
      // Create a ContentHandler to handle parsing of the XML source.   
      TransformerHandler handler 
        = saxTFactory.newTransformerHandler(templates);
      // Reset the XMLReader's ContentHandler. 
      reader.setContentHandler(handler);  
 
      // Set the ContentHandler to also function as a LexicalHandler, which 
      // includes "lexical" events (e.g., comments and CDATA).  
5
CodeRank
Experience pair programming with AI  Get Codota for Java
This code example shows how to use the following methods:getTemplates
    } 
 
    private Templates compileTemplate(DBBroker broker, DocumentImpl stylesheet) throws TransformerConfigurationException, SAXException {
        final Serializer serializer = broker.getSerializer();
        final TemplatesHandler thandler = factory.newTemplatesHandler();
        serializer.setSAXHandlers(thandler, null);
        serializer.toSAX(stylesheet);
        return thandler.getTemplates();
    } 
 
    private class CachedTemplate { 
 
        private final Templates templates;
        private final long lastUpdated;
 
        public CachedTemplate(Templates templates, long lastUpdated) {
            this.templates = templates;
            this.lastUpdated = lastUpdated;
        } 
 
4
CodeRank
Experience pair programming with AI  Get Codota for Java
See Code Examples for Java 8 TemplatesHandler Methods: