gnu.xml.pipeline

Class XsltFilter

Implemented Interfaces:
ContentHandler, ContentHandler2, DeclHandler, DTDHandler, EventConsumer, LexicalHandler

public final class XsltFilter
extends EventFilter

Packages an XSLT transform as a pipeline component. Note that all DTD events (callbacks to DeclHandler and DTDHandler interfaces) are discarded, although XSLT transforms may be set up to use the LexicalHandler to write DTDs with only an external subset. Not every XSLT engine will necessarily be usable with this filter, but current versions of SAXON and Xalan should work well.

See Also:
TransformerFactory

Field Summary

Fields inherited from class gnu.xml.pipeline.EventFilter

DECL_HANDLER, FEATURE_URI, LEXICAL_HANDLER, PROPERTY_URI

Constructor Summary

XsltFilter(String stylesheet, EventConsumer next)
Creates a filter that performs the specified transform.

Method Summary

Methods inherited from class gnu.xml.pipeline.EventFilter

attributeDecl, bind, chainTo, characters, comment, elementDecl, endCDATA, endDTD, endDocument, endElement, endEntity, endPrefixMapping, externalEntityDecl, getContentHandler, getDTDHandler, getDocumentLocator, getErrorHandler, getNext, getProperty, ignorableWhitespace, internalEntityDecl, notationDecl, processingInstruction, setContentHandler, setDTDHandler, setDocumentLocator, setErrorHandler, setProperty, skippedEntity, startCDATA, startDTD, startDocument, startElement, startEntity, startPrefixMapping, unparsedEntityDecl, xmlDecl

Constructor Details

XsltFilter

public XsltFilter(String stylesheet,
                  EventConsumer next)
            throws SAXException,
                   IOException
Creates a filter that performs the specified transform. Uses the JAXP 1.1 interfaces to access the default XSLT engine configured for in the current execution context, and parses the stylesheet without custom EntityResolver or ErrorHandler support.

Parameters:
stylesheet - URI for the stylesheet specifying the XSLT transform
next - provides the ContentHandler and LexicalHandler to receive XSLT output.

Throws:
SAXException - if the stylesheet can't be parsed