org.apache.cocoon.components.xslt
Interface XSLTProcessor

All Known Implementing Classes:
XSLTProcessorImpl

public interface XSLTProcessor

This is the interface of the XSLT processor.

Version:
$Id: XSLTProcessor.html 1304280 2012-03-23 11:18:01Z ilgrosso $

Nested Class Summary
static class XSLTProcessor.TransformerHandlerAndValidity
           
 
Method Summary
 TransformerHandler getTransformerHandler(Source stylesheet)
          Same as getTransformerHandler(Source,XMLFilter), with filter set to null.
 TransformerHandler getTransformerHandler(Source stylesheet, XMLFilter filter)
          Return a TransformerHandler for a given stylesheet Source.
 XSLTProcessor.TransformerHandlerAndValidity getTransformerHandlerAndValidity(Source stylesheet)
          Same as getTransformerHandlerAndValidity(Source,XMLFilter), with filter set to null.
 XSLTProcessor.TransformerHandlerAndValidity getTransformerHandlerAndValidity(Source stylesheet, XMLFilter filter)
          Return a TransformerHandler and SourceValidity for a given stylesheet Source.
 void transform(Source source, Source stylesheet, Map params, Result result)
          Applies an XSLT stylesheet to an XML document.
 

Method Detail

getTransformerHandler

public TransformerHandler getTransformerHandler(Source stylesheet,
                                                XMLFilter filter)
                                         throws XSLTProcessorException

Return a TransformerHandler for a given stylesheet Source. This can be used in a pipeline to handle the transformation of a stream of SAX events. See TraxTransformer.setConsumer(org.apache.cocoon.xml.XMLConsumer) for an example of how to use this method.

The additional filter argument, if it's not null, is inserted in the chain SAX events as an XML filter during the parsing or the source document.

This method caches the Templates object with meta information (modification time and list of included stylesheets) and performs a reparsing only if this changes.

Parameters:
stylesheet - a Source value
filter - a XMLFilter value
Returns:
a TransformerHandler value
Throws:
XSLTProcessorException - if an error occurs

getTransformerHandlerAndValidity

public XSLTProcessor.TransformerHandlerAndValidity getTransformerHandlerAndValidity(Source stylesheet,
                                                                                    XMLFilter filter)
                                                                             throws XSLTProcessorException

Return a TransformerHandler and SourceValidity for a given stylesheet Source. This can be used in a pipeline to handle the transformation of a stream of SAX events. See TraxTransformer.setConsumer(org.apache.cocoon.xml.XMLConsumer) for an example of how to use this method.

The additional filter argument, if it's not null, is inserted in the chain SAX events as an XML filter during the parsing or the source document.

This method caches the Templates object with meta information (modification time and list of included stylesheets) and performs a reparsing only if this changes.

Parameters:
stylesheet - a Source value
filter - a XMLFilter value
Returns:
a TransformerHandlerAndValidity value
Throws:
XSLTProcessorException - if an error occurs

getTransformerHandler

public TransformerHandler getTransformerHandler(Source stylesheet)
                                         throws XSLTProcessorException
Same as getTransformerHandler(Source,XMLFilter), with filter set to null.

Parameters:
stylesheet - a Source value
Returns:
a TransformerHandler value
Throws:
XSLTProcessorException - if an error occurs

getTransformerHandlerAndValidity

public XSLTProcessor.TransformerHandlerAndValidity getTransformerHandlerAndValidity(Source stylesheet)
                                                                             throws XSLTProcessorException
Same as getTransformerHandlerAndValidity(Source,XMLFilter), with filter set to null.

Parameters:
stylesheet - a Source value
Returns:
a XSLTProcessor.TransformerHandlerAndValidity value
Throws:
XSLTProcessorException - if an error occurs

transform

public void transform(Source source,
                      Source stylesheet,
                      Map params,
                      Result result)
               throws XSLTProcessorException
Applies an XSLT stylesheet to an XML document. The source and stylesheet documents are specified as Source objects. The result of the transformation is placed in Result, which should be properly initialized before invoking this method. Any additional parameters passed in params will become arguments to the stylesheet.

Parameters:
source - a Source value
stylesheet - a Source value
params - a Map
result - a Result value
Throws:
XSLTProcessorException - if an error occurs


Copyright 1999-2008 The Apache Software Foundation. All Rights Reserved.