Package org.apache.trax

Examples of org.apache.trax.TemplatesBuilder


    // Get the XMLReader.
    XMLReader reader = XMLReaderFactory.createXMLReader();

    // Set the ContentHandler.
    TemplatesBuilder templatesBuilder = processor.getTemplatesBuilder();
    reader.setContentHandler(templatesBuilder);

    // Set the ContentHandler to also function as a LexicalHandler, which
    // includes "lexical" (e.g., comments and CDATA) events. The Xalan
    // TemplatesBuilder -- org.apache.xalan.processor.StylesheetHandler -- is
    // also a LexicalHandler).
    if(templatesBuilder instanceof LexicalHandler) {
       reader.setProperty("http://xml.org/sax/properties/lexical-handler",
                           templatesBuilder);
    }

    // Parse the stylesheet.                      
    reader.parse(args[0]);

    //Get the Templates object from the ContentHandler.
    Templates templates = templatesBuilder.getTemplates();

    // III. Use the Templates object to instantiate a Transformer.
    Transformer transformer = templates.newTransformer();

    // IV. Perform the transformation.
View Full Code Here


    // Get the XMLReader.
    XMLReader reader = XMLReaderFactory.createXMLReader();

    // Set the ContentHandler.
    TemplatesBuilder templatesBuilder = processor.getTemplatesBuilder();
    reader.setContentHandler(templatesBuilder);

    // Set the ContentHandler to also function as a LexicalHandler, which
    // includes "lexical" (e.g., comments and CDATA) events. The Xalan
    // TemplatesBuilder -- org.apache.xalan.processor.StylesheetHandler -- is
    // also a LexicalHandler).
    if(templatesBuilder instanceof LexicalHandler) {
       reader.setProperty("http://xml.org/sax/properties/lexical-handler",
                           templatesBuilder);
    }

    // Parse the stylesheet.                      
    reader.parse(args[0]);

    //Get the Templates object from the ContentHandler.
    Templates templates = templatesBuilder.getTemplates();

    // III. Use the Templates object to instantiate a Transformer.
    Transformer transformer = templates.newTransformer();

    // IV. Perform the transformation.
View Full Code Here

    // Get the XMLReader.
    XMLReader reader = XMLReaderFactory.createXMLReader();

    // Set the ContentHandler.
    TemplatesBuilder templatesBuilder = processor.getTemplatesBuilder();
    reader.setContentHandler(templatesBuilder);

    // Set the ContentHandler to also function as a LexicalHandler, which
    // includes "lexical" (e.g., comments and CDATA) events. The Xalan
    // TemplatesBuilder -- org.apache.xalan.processor.StylesheetHandler -- is
    // also a LexicalHandler).
    if(templatesBuilder instanceof LexicalHandler) {
       reader.setProperty("http://xml.org/sax/properties/lexical-handler",
                           templatesBuilder);
    }

    // Parse the stylesheet.                      
    reader.parse(args[0]);

    //Get the Templates object from the ContentHandler.
    Templates templates = templatesBuilder.getTemplates();

    // III. Use the Templates object to instantiate a Transformer.
    Transformer transformer = templates.newTransformer();

    // IV. Perform the transformation.
View Full Code Here

TOP

Related Classes of org.apache.trax.TemplatesBuilder

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.