Examples of newTemplates()


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

      // The TransformerFactory will compile the stylesheet and
      // put the translet classes inside the Templates object
      TransformerFactory factory = TransformerFactory.newInstance();
            factory.setAttribute("generate-translet", Boolean.TRUE);
      Templates templates = factory.newTemplates(stylesheet);
        }
  catch (Exception e) {
            System.err.println("Exception: " + e);
      e.printStackTrace();
        }
View Full Code Here

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

    try
    {
      // Instantiate the TransformerFactory, and use it along with a SteamSource
      // XSL stylesheet to create a translet as a Templates object.
      TransformerFactory tFactory = TransformerFactory.newInstance();
      Templates translet = tFactory.newTemplates(new StreamSource(xslInURI));
   
      // Perform each transformation
      doTransform(translet, "todo.xml", "todo.html");
      System.out.println("Produced todo.html");
   
View Full Code Here

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

    try {
      // Create transformer factory
      TransformerFactory factory = TransformerFactory.newInstance();

      // Use the factory to create a template containing the xsl file
      Templates template = factory.newTemplates(new StreamSource(
          new FileInputStream(xslfile)));

      // Use the template to create a transformer
      Transformer xformer = template.newTransformer();
     
View Full Code Here

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

  }

  private Templates parseXslt(String xsltValue) throws Exception {
    Source source = new StreamSource(new StringReader(xsltValue));
    TransformerFactory factory = TransformerFactory.newInstance();
    return factory.newTemplates(source);
  }

  private void setParams(Transformer transformer, TransformContext context) {
    for (ParamTag param : parameterList) {
      String paramName = param.getVar();
View Full Code Here

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

        if (translet == null ) {
            String templateUrl = (String)context.get("templateUrl");
            String templateString = (String)context.get("templateString");
            Document templateDocument = (Document)context.get("templateDocument");
            Source templateSource = getSource(templateDocument, templateUrl, templateString);
            translet = tFactory.newTemplates(templateSource);
            if (UtilValidate.isNotEmpty(templateName)) {
                    xslTemplatesCache.put(templateName, translet);
            }
        }
        if (translet != null ) {
View Full Code Here

Examples of javax.xml.transform.sax.SAXTransformerFactory.newTemplates()

        }

        SAXTransformerFactory saxtf = (SAXTransformerFactory) tf;
        Templates templates = null;
        if (xslt != null) {
            templates = saxtf.newTemplates(xslt);
        }

        // configuring outHandlerFactory
        // ///////////////////////////////////////////////////////
View Full Code Here

Examples of javax.xml.transform.sax.SAXTransformerFactory.newTemplates()

              && ssNode instanceof ElemLiteralResult)
          {
            AVT avt = ((ElemLiteralResult)ssNode).getLiteralResultAttribute("href");
            String href = avt.evaluate(xctxt,xt, elem);
            String absURI = SystemIDResolver.getAbsoluteURI(href, sysId);
            Templates tmpl = saxTFactory.newTemplates(new StreamSource(absURI));
            TransformerHandler tHandler = saxTFactory.newTransformerHandler(tmpl);
            Transformer trans = tHandler.getTransformer();
           
            // AddTransformerHandler to vector
            vTHandler.addElement(tHandler);
View Full Code Here

Examples of javax.xml.transform.sax.SAXTransformerFactory.newTemplates()

              && ssNode instanceof ElemLiteralResult)
          {
            AVT avt = ((ElemLiteralResult)ssNode).getLiteralResultAttribute("href");
            String href = avt.evaluate(xctxt,xt, elem);
            String absURI = SystemIDResolver.getAbsoluteURI(href, sysId);
            Templates tmpl = saxTFactory.newTemplates(new StreamSource(absURI));
            TransformerHandler tHandler = saxTFactory.newTransformerHandler(tmpl);
            Transformer trans = tHandler.getTransformer();
           
            // AddTransformerHandler to vector
            vTHandler.addElement(tHandler);
View Full Code Here

Examples of javax.xml.transform.sax.SAXTransformerFactory.newTemplates()

    if( !tf.getFeature( SAXSource.FEATURE) || !tf.getFeature( SAXResult.FEATURE)) return 0;
   
    SAXTransformerFactory saxtf = ( SAXTransformerFactory) tf;
    Templates templates = null;
    if( xslt!=null) {
      templates = saxtf.newTemplates( xslt);
    }
   

    // configuring outHandlerFactory ///////////////////////////////////////////////////////
View Full Code Here

Examples of javax.xml.transform.sax.SAXTransformerFactory.newTemplates()

        }

        SAXTransformerFactory saxtf = (SAXTransformerFactory) tf;
        Templates templates = null;
        if (xslt != null) {
            templates = saxtf.newTemplates(xslt);
        }

        // configuring outHandlerFactory
        // ///////////////////////////////////////////////////////
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.