org.inria.ns.reflex.xml.sax
Class XSLTFilter

java.lang.Object
  extended by org.xml.sax.helpers.XMLFilterImpl
      extended by org.inria.ns.reflex.xml.sax.SAXFilter
          extended by org.inria.ns.reflex.xml.sax.SAXSafeDocument
              extended by org.inria.ns.reflex.xml.sax.XSLTFilter
All Implemented Interfaces:
Localizable, ContentHandler, DTDHandler, EntityResolver, ErrorHandler, DeclHandler, LexicalHandler, XMLFilter, XMLReader

public class XSLTFilter
extends SAXSafeDocument

An XMLFilterImpl made from a TransformerHandler.

Author:
Philippe Poulard

Constructor Summary
XSLTFilter(XMLReader reader, TransformerHandler transformerHandler)
          Create a SAX filter from a handler.
 
Method Summary
 void comment(char[] ch, int start, int length)
          Transmit this event to the transformer.
 void endCDATA()
          Transmit this event to the transformer.
 void endDTD()
          Transmit this event to the transformer.
 void endEntity(String name)
          Transmit this event to the transformer.
 void notationDecl(String name, String publicId, String systemId)
          Transmit this event to the transformer.
 void parse(InputSource input)
          Perform the transformation by consuming SAX events.
 void parse(String systemId)
          Perform the transformation by consuming SAX events.
 void startCDATA()
          Transmit this event to the transformer.
 void startDTD(String name, String publicId, String systemId)
          Transmit this event to the transformer.
 void startEntity(String name)
          Transmit this event to the transformer.
 void unparsedEntityDecl(String name, String publicId, String systemId, String notationName)
          Transmit this event to the transformer.
 
Methods inherited from class org.inria.ns.reflex.xml.sax.SAXSafeDocument
characters, startElement
 
Methods inherited from class org.inria.ns.reflex.xml.sax.SAXFilter
attributeDecl, elementDecl, endDocument, externalEntityDecl, getDeclHandler, getLexicalHandler, getLocation, getProperty, internalEntityDecl, isLocalizable, setDeclHandler, setLexicalHandler, setLocation, setProperty, startDocument
 
Methods inherited from class org.xml.sax.helpers.XMLFilterImpl
endElement, endPrefixMapping, error, fatalError, getContentHandler, getDTDHandler, getEntityResolver, getErrorHandler, getFeature, getParent, ignorableWhitespace, processingInstruction, resolveEntity, setContentHandler, setDocumentLocator, setDTDHandler, setEntityResolver, setErrorHandler, setFeature, setParent, skippedEntity, startPrefixMapping, warning
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.xml.sax.ContentHandler
endElement, endPrefixMapping, ignorableWhitespace, processingInstruction, setDocumentLocator, skippedEntity, startPrefixMapping
 

Constructor Detail

XSLTFilter

public XSLTFilter(XMLReader reader,
                  TransformerHandler transformerHandler)
Create a SAX filter from a handler.

Parameters:
reader - The SAX event provider.
transformerHandler - The handler that perform the transformation.
Method Detail

parse

public void parse(InputSource input)
           throws SAXException,
                  IOException
Perform the transformation by consuming SAX events.

Specified by:
parse in interface XMLReader
Overrides:
parse in class XMLFilterImpl
Parameters:
input - The XML source to parse.
Throws:
SAXException - If an invalid XML data is encountered.
IOException - If an I/O error occurs.

parse

public void parse(String systemId)
           throws SAXException,
                  IOException
Perform the transformation by consuming SAX events.

Specified by:
parse in interface XMLReader
Overrides:
parse in class SAXFilter
Parameters:
systemId - The XML source to parse.
Throws:
SAXException - If an invalid XML data is encountered.
IOException - If an I/O error occurs.
See Also:
XMLFilterImpl.parse(java.lang.String)

startDTD

public void startDTD(String name,
                     String publicId,
                     String systemId)
              throws SAXException
Transmit this event to the transformer.

Specified by:
startDTD in interface LexicalHandler
Overrides:
startDTD in class SAXSafeDocument
Parameters:
name - The document type name.
publicId - The public ID of the DTD or null.
systemId - The system ID of the DTD or null.
Throws:
SAXException - If an invalid XML data is encountered.
See Also:
LexicalHandler.startDTD(java.lang.String, java.lang.String, java.lang.String)

endDTD

public void endDTD()
            throws SAXException
Transmit this event to the transformer.

Specified by:
endDTD in interface LexicalHandler
Overrides:
endDTD in class SAXSafeDocument
Throws:
SAXException - If an invalid XML data is encountered.
See Also:
LexicalHandler.endDTD()

startEntity

public void startEntity(String name)
                 throws SAXException
Transmit this event to the transformer.

Specified by:
startEntity in interface LexicalHandler
Overrides:
startEntity in class SAXFilter
Parameters:
name - The name of the entity.
Throws:
SAXException - If an invalid XML data is encountered.
See Also:
LexicalHandler.startEntity(java.lang.String)

endEntity

public void endEntity(String name)
               throws SAXException
Transmit this event to the transformer.

Specified by:
endEntity in interface LexicalHandler
Overrides:
endEntity in class SAXFilter
Parameters:
name - The name of the entity.
Throws:
SAXException - If an invalid XML data is encountered.
See Also:
LexicalHandler.endEntity(java.lang.String)

startCDATA

public void startCDATA()
                throws SAXException
Transmit this event to the transformer.

Specified by:
startCDATA in interface LexicalHandler
Overrides:
startCDATA in class SAXFilter
Throws:
SAXException - If an invalid XML data is encountered.
See Also:
LexicalHandler.startCDATA()

endCDATA

public void endCDATA()
              throws SAXException
Transmit this event to the transformer.

Specified by:
endCDATA in interface LexicalHandler
Overrides:
endCDATA in class SAXFilter
Throws:
SAXException - If an invalid XML data is encountered.
See Also:
LexicalHandler.endCDATA()

comment

public void comment(char[] ch,
                    int start,
                    int length)
             throws SAXException
Transmit this event to the transformer.

Specified by:
comment in interface LexicalHandler
Overrides:
comment in class SAXFilter
Parameters:
ch - The content of the comment.
start - The index where the comment starts.
length - The length of the text.
Throws:
SAXException - If an invalid XML data is encountered.
See Also:
LexicalHandler.comment(char[], int, int)

notationDecl

public void notationDecl(String name,
                         String publicId,
                         String systemId)
                  throws SAXException
Transmit this event to the transformer.

Specified by:
notationDecl in interface DTDHandler
Overrides:
notationDecl in class XMLFilterImpl
Parameters:
name - The name of the notation.
publicId - The public ID of the notation.
systemId - The system ID of the notation.
Throws:
SAXException - If an invalid XML data is encountered.
See Also:
DTDHandler.notationDecl(java.lang.String, java.lang.String, java.lang.String)

unparsedEntityDecl

public void unparsedEntityDecl(String name,
                               String publicId,
                               String systemId,
                               String notationName)
                        throws SAXException
Transmit this event to the transformer.

Specified by:
unparsedEntityDecl in interface DTDHandler
Overrides:
unparsedEntityDecl in class XMLFilterImpl
Parameters:
name - The name of the entity.
publicId - The public ID of the entity.
systemId - The system ID of the entity.
notationName - The notation.
Throws:
SAXException - If an invalid XML data is encountered.
See Also:
DTDHandler.unparsedEntityDecl(java.lang.String, java.lang.String, java.lang.String, java.lang.String)