Package javax.xml.transform

Examples of javax.xml.transform.TransformerFactory.newTemplates()


      if (DebugFile.trace) DebugFile.writeln("TransformerFactory.newInstance()");
      oFactory = TransformerFactory.newInstance();
      if (DebugFile.trace) DebugFile.writeln("new StreamSource("+sFilePath+")");
      oStreamSrc = new StreamSource(sFilePath);
      if (DebugFile.trace) DebugFile.writeln("TransformerFactory.newTemplates(StreamSource)");
      oTemplates = oFactory.newTemplates(oStreamSrc);
      oSheet = new SheetEntry(lastMod, oTemplates);
      if (DebugFile.trace) DebugFile.writeln("WeakHashMap.put("+sFilePath+", SheetEntry)");
      oCache.put(sFilePath, oSheet);
    } // fi
View Full Code Here


    ByteArrayOutputStream oOutputStream = new ByteArrayOutputStream();

    TransformerFactory oFactory = TransformerFactory.newInstance();
    StreamSource oStreamSrc = new StreamSource(oStyleSheetStream);
    Templates oTemplates = oFactory.newTemplates(oStreamSrc);
    Transformer oTransformer = oTemplates.newTransformer();

    if (null!=oProps) setParameters(oTransformer, oProps);
    StreamSource oStreamSrcXML = new StreamSource(oXMLInputStream);
    StreamResult oStreamResult = new StreamResult(oOutputStream);
View Full Code Here

                        + transformTarget.getXslFilename());

        TransformerFactory tf = TransformerFactory.newInstance();

        StreamSource source = new StreamSource(xsl);
        Templates templates = tf.newTemplates(source);

        Transformer trf = templates.newTransformer();

        trf.transform(new StreamSource(input), new StreamResult(output));
    }
View Full Code Here

    if(uriResolver != null){
      transFact.setURIResolver(uriResolver);
    }

    this.templates = transFact.newTemplates(xsltSource);
    this.file = f;
  }

  @Override
  public String toString() {
View Full Code Here

  private void cacheStyleSheet(Class<?> resourceClass, String path) throws TransformerConfigurationException{
    InputStream inputStream = resourceClass.getResourceAsStream(path);
    Source xsltSource = new StreamSource(inputStream);
    TransformerFactory transFact = TransformerFactory.newInstance();
    Templates templates = transFact.newTemplates(xsltSource);

    try {inputStream.close();} catch (IOException e) {}

    this.templates = templates;
    this.resourceClass = resourceClass;
View Full Code Here

    if(uriResolver != null){
      transFact.setURIResolver(uriResolver);
    }

    this.templates = transFact.newTemplates(new StreamSource(uri.toString()));
  }

  @Override
  public String toString() {
View Full Code Here

                Source xslSource = new StreamSource(is);
                // Note that if we don't do this, relative URLs can not be
                // resolved correctly!
                xslSource.setSystemId(getServletContext().getRealPath(
                        xsltStyleSheet));
                this.templates = tfactory.newTemplates(xslSource);
            } catch (TransformerConfigurationException tce) {
                throw new ServletException("Error parsing XSLT stylesheet: "
                        + xsltStyleSheet, tce);
            }
View Full Code Here

                // Note that if we don't do this, relative URLs can not be
                // resolved correctly!
                xslSource.setSystemId(getServletContext().getRealPath(
                        xsltStyleSheet));
            }
            this.templates = tfactory.newTemplates(xslSource);
        } catch (TransformerConfigurationException tce) {
            throw new ServletException("Error parsing XSLT stylesheet: "
                    + xsltStyleSheet, tce);
        }
View Full Code Here

                // Note that if we don't do this, relative URLs can not be
                // resolved correctly!
                xslSource.setSystemId(getServletContext().getRealPath(
                        xsltStyleSheet));
            }
            this.templates = tfactory.newTemplates(xslSource);
        } catch (TransformerConfigurationException tce) {
            throw new ServletException("Error parsing XSLT stylesheet: "
                    + xsltStyleSheet, tce);
        }
View Full Code Here

          if (log.isLoggable(Level.FINE))
            log.fine(L.l("'{0}' XSLT filter using stylesheet {1}",
                         req.getRequestURI(), source.getSystemId()));

          stylesheet = factory.newTemplates(source);
        } finally {
          // is.close();
        }
       
        Transformer transformer = null;
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.