Examples of TemplatesHandler


Examples of javax.xml.transform.sax.TemplatesHandler

     */
    private Templates templates() throws CannotExecuteException {
  try {
      synchronized (result) {
    if (templatesCache == null && xsltSource != null) {
        TemplatesHandler templHand
      = saxTransFact().newTemplatesHandler();
        xsltSource.emit(templHand);
        // Now the TemplatesHandler contains the xslt information
        templatesCache = templHand.getTemplates();
    }
      }
      return templatesCache;
  } catch (TransformerConfigurationException e) {
      String msg = "Error creating TransformerHandler: " + e.getMessage();
View Full Code Here

Examples of javax.xml.transform.sax.TemplatesHandler

      return temp;
    } else {
      // Get the Templates and cache them
      try
      {
        TemplatesHandler thand = getSAXTFactory().newTemplatesHandler();
        XMLReader reader = XMLReaderFactory.createXMLReader();
        reader.setContentHandler(thand);
        reader.parse(stylesheetURI);
        temp = thand.getTemplates();
        if (stylesheetRootCacheEnabled) {
          stylesheetRootCache.put(stylesheetURI, temp);
          if (log.isInfoEnabled()) {
              log.info( "Cached templates for: " + stylesheetURI);
          }
View Full Code Here

Examples of javax.xml.transform.sax.TemplatesHandler

    private Templates serializerTemplates() throws CannotExecuteException {
        try {
            synchronized (result) {
                if (serializerTemplatesCache == null) {
                    if (serializerTemplates != null) {
                        TemplatesHandler templHand
                            = saxTransFact().newTemplatesHandler();
                        serializerTemplates.emit(templHand);
                        // TemplatesHandler contains the xslt information
                        serializerTemplatesCache = templHand.getTemplates();
                    } else {
                        InputStream xslIn
                          = SAXContentBuffer.class.getResourceAsStream
                          ("/de/danet/an/workflow/tools/xmlrpc/serializer.xsl");
                        serializerTemplatesCache = saxTransFact()
View Full Code Here

Examples of javax.xml.transform.sax.TemplatesHandler

    private Templates parserTemplates() throws CannotExecuteException {
        try {
            synchronized (result) {
                if (parserTemplatesCache == null) {
                    if (parserTemplates != null) {
                        TemplatesHandler templHand
                            = saxTransFact().newTemplatesHandler();
                        parserTemplates.emit(templHand);
                        // TemplatesHandler contains the xslt information
                        parserTemplatesCache = templHand.getTemplates();
                    } else {
                        InputStream xslIn
                          = SAXContentBuffer.class.getResourceAsStream
                          ("/de/danet/an/workflow/tools/xmlrpc/parser.xsl");
                        parserTemplatesCache = saxTransFact()
View Full Code Here

Examples of javax.xml.transform.sax.TemplatesHandler

                    getLogger().debug("Creating new Templates for " + id);
                }

                // Create a Templates ContentHandler to handle parsing of the
                // stylesheet.
                TemplatesHandler templatesHandler = this.factory.newTemplatesHandler();

                // Set the system ID for the template handler since some
                // TrAX implementations (XSLTC) rely on this in order to obtain
                // a meaningful identifier for the Templates instances.
                templatesHandler.setSystemId(id);

                if (filter != null) {
                    filter.setContentHandler(templatesHandler);
                }

                if (this.getLogger().isDebugEnabled()) {
                    getLogger().debug("Source = " + stylesheet
                    + ", templatesHandler = " + templatesHandler);
                }

                // Process the stylesheet.
                stylesheet.toSAX(filter != null ?
                            (ContentHandler)filter : (ContentHandler)templatesHandler);

                // Get the Templates object (generated during the parsing of
                // the stylesheet) from the TemplatesHandler.
                templates = templatesHandler.getTemplates();
                putTemplates (templates, stylesheet, id);
            } else {
                if (this.getLogger().isDebugEnabled()) {
                    getLogger().debug("Reusing Templates for " + id);
                }
View Full Code Here

Examples of javax.xml.transform.sax.TemplatesHandler

        try
        {
            // Cast the TransformerFactory.
            SAXTransformerFactory saxTFactory = ((SAXTransformerFactory) tFactory);
            // 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);
            // Set it to solve Entities through Jetspeed URL Manager
            reader.setEntityResolver( new JetspeedXMLEntityResolver() );
   
            // Parse the stylesheet.                      
            final InputSource xstyle = new InputSource( JetspeedDiskCache.getInstance()
                                                        .getEntry( stylesheet_url ).getReader() );
            xstyle.setSystemId( stylesheet_url );
            reader.parse( xstyle );

            //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.
View Full Code Here

Examples of javax.xml.transform.sax.TemplatesHandler

        try
        {
            // Cast the TransformerFactory.
            SAXTransformerFactory saxTFactory = ((SAXTransformerFactory) tFactory);
            // 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( stylesheet );

            //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.
View Full Code Here

Examples of javax.xml.transform.sax.TemplatesHandler

        try
        {
            // Cast the TransformerFactory.
            SAXTransformerFactory saxTFactory = ((SAXTransformerFactory) tFactory);
            // 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);
            // Set it to solve Entities through Jetspeed URL Manager
            reader.setEntityResolver( new JetspeedXMLEntityResolver() );

            // Parse the stylesheet.                      
            InputSource style = new InputSource( JetspeedDiskCache.getInstance()
                                                 .getEntry( stylesheet_url ).getReader() );
            style.setSystemId( stylesheet_url );
            final InputSource xstyle = style;

            reader.parse( xstyle );

            //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.
View Full Code Here

Examples of javax.xml.transform.sax.TemplatesHandler

        try
        {
            // Cast the TransformerFactory.
            SAXTransformerFactory saxTFactory = ((SAXTransformerFactory) tFactory);
            // 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);
            // Set it to solve Entities through Jetspeed URL Manager
            reader.setEntityResolver( new JetspeedXMLEntityResolver() );
   
            // Parse the stylesheet.                      
            final InputSource xstyle = new InputSource( JetspeedDiskCache.getInstance()
                                                        .getEntry( stylesheet_url ).getReader() );
            xstyle.setSystemId( stylesheet_url );
            reader.parse( xstyle );

            //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.
View Full Code Here

Examples of javax.xml.transform.sax.TemplatesHandler

        try
        {
            // Cast the TransformerFactory.
            SAXTransformerFactory saxTFactory = ((SAXTransformerFactory) tFactory);
            // 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( stylesheet );

            //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.
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.