Package org.apache.xalan.xslt

Examples of org.apache.xalan.xslt.StylesheetRoot


    protected StylesheetRoot compileStylesheetRoot (String source) throws Exception
    {
        XSLTProcessor processor = XSLTProcessorFactory.getProcessor();
       
        XSLTInputSource xslin = new XSLTInputSource("file:///"+source);
        StylesheetRoot root = processor.processStylesheet(xslin);

        return root;
    }
View Full Code Here


           
            String fn = getFileName (xslName);
           
            if (fn == null) return null;
           
            StylesheetRoot sr = compileStylesheetRoot (fn);       
           
            if (caching)
            {
                cache.put (xslName,sr);
            }
View Full Code Here

       
    }
   
    protected void transform (String xslName, XSLTProcessor processor, XSLTInputSource xmlin, XSLTResultTarget xmlout) throws Exception
    {
        StylesheetRoot sr = getStylesheetRoot(xslName);
       
        // If there is no stylesheet we just echo the xml
        if (sr == null)
        {
            String line;
View Full Code Here

        File dir = new File(dirStr);
        dir.mkdirs();
      }
    }

    StylesheetRoot sr = context.stylesheetTree.m_stylesheetRoot;
    OutputFormat formatter = sr.getOutputFormat();

    FileOutputStream ostream = new FileOutputStream(file);

    DocumentHandler flistener
      = sr.makeSAXSerializer(ostream, formatter);

    flistener.startDocument();
    if(shouldPutInTable)
    {
      m_outputStreams.put(fileName, ostream);
View Full Code Here

    // Create an empty StylesheetRoot. The createStylesheetRoot(String baseURI) method is not
    // part of the XSLTProcessor interface, so must use the underlying XSLTEngineImpl object.
    // The baseURI is for resolving relative URIs. If null is sent, defaults to the current
    // directory.
    StylesheetRoot stylesheet = ((XSLTEngineImpl)processor).createStylesheetRoot(null);

    // Set up a StylesheetHandler (a SAX DocumentHandler) to receive events
    // as the Stylesheet is parsed.
    StylesheetHandler stylesheetHandler
      = new StylesheetHandler((XSLTEngineImpl)processor, stylesheet);
View Full Code Here

  {
    // Use the XSLTProcessorFactory to create a processor.
    XSLTProcessor processor = XSLTProcessorFactory.getProcessor();

    // Compile the two stylesheets.
    StylesheetRoot stylesheet = processor.processStylesheet("foo.xsl");
    StylesheetRoot stylesheet2 = processor.processStylesheet("foo2.xsl");

    // Don't really need to set the processor Stylesheet property, since it's
    // still set from the 2nd processStylesheet, but it's good form....
    processor.setStylesheet(stylesheet2);

    // Get and set a DocumentHandler for final output.
    processor.setDocumentHandler(stylesheet2.getSAXSerializer(System.out));

    // Use the processor (which extends DocumentHandler) to instantiate the
    // XSLTResultTarget object for the first transform.
    XSLTResultTarget firstResult = new XSLTResultTarget(processor);
    // firstResult now functions as a SAX DocumentHandler.
View Full Code Here

                String uri = (String)it.next();
                Node n = (Node)it.next();

                XSLTInputSource is = new XSLTInputSource(n);
                is.setSystemId(uri);
                StylesheetRoot ss = p.processStylesheet(is);

                StringWriter w = new StringWriter();

                ss.process(new XSLTInputSource(r), new XSLTResultTarget(w));
                r = new StringReader(w.getBuffer().toString());
            }

            /*
            Processor p = Processor.newInstance("xslt");
View Full Code Here

TOP

Related Classes of org.apache.xalan.xslt.StylesheetRoot

Copyright © 2018 www.massapicom. 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.