com.jclark.xsl.sax2

Class XSLProcessorImpl

Implemented Interfaces:
Cloneable, XMLReader, ParameterSet, XSLProcessor

public class XSLProcessorImpl
extends java.lang.Object
implements XSLProcessor, Cloneable, ParameterSet

An XSLT Processor

Constructor Summary

XSLProcessorImpl()
XSLProcessorImpl(Sheet sheet, Engine engine)

Method Summary

void
clearParameters()
Object
clone()
ContentHandler
getContentHandler()
SAX 2 XMLReader API.
DTDHandler
getDTDHandler()
SAX XMLReader API
EntityResolver
getEntityResolver()
SAX XMLReader API
ErrorHandler
getErrorHandler()
SAX API
boolean
getFeature(String featureURI)
SAX API
Object
getParameter(String name)
recognizes names in the form "{namespace-part}local-part" as used in TrAX
Object
getParameter(Name name)
Object
getProperty(java.lang.String name)
SAX API
(package private) void
handleXSLException(XSLException e)
rethrows an XSLException as a SAXException
void
loadStylesheet(InputSource sheetSource)
load (and compile) the stylesheet
void
parse(InputSource source)
load the input document into a (xslt) object model, and run the transform
void
parse(String sourceURI)
SAX XMLReader API
(package private) void
phase(int n)
void
setContentHandler(ContentHandler handler)
SAX 2 XMLReader API.
void
setDTDHandler(DTDHandler handler)
SAX XMLReader API
void
setDebugger(String name, ActionDebugTarget debugger)
sets an extension element processor for XRAP
void
setEntityResolver(EntityResolver resolver)
SAX XMLReader API
void
setErrorHandler(ErrorHandler handler)
SAX API
void
setFeature(String featureURI, boolean value)
SAX API
void
setOutputMethodHandler(OutputMethodHandler handler)
we can have either an OutputMethodHandler, or a DocumentHandler, not both
void
setParameter(String name, Object obj)
recognizes names in the form "{namespace-part}local-part" as used in TrAX
void
setProperty(java.lang.String name, java.lang.Object value)
SAX API
void
setReaders(XMLReader sourceReader, XMLReader sheetReader)
set two XMLReaders (may be the same XMLReader), #1 for parsing the XML source to transform, #2 for parsing the stylesheeet.
void
setSaxExtensionFilter(String name, SaxFilterMaker xrap)
sets an extension element processor for XRAP
void
setSourceReader(XMLReader sourceReader)
prepare for parsing the input XML document

Constructor Details

XSLProcessorImpl

public XSLProcessorImpl()

XSLProcessorImpl

public XSLProcessorImpl(Sheet sheet,
                        Engine engine)

Method Details

clearParameters

public void clearParameters()

clone

public Object clone()
Specified by:
clone in interface XSLProcessor

getContentHandler

public ContentHandler getContentHandler()
SAX 2 XMLReader API. .. return the content handler this is writing to
Returns:
null in no ContentHandler was set

getDTDHandler

public DTDHandler getDTDHandler()
SAX XMLReader API

getEntityResolver

public EntityResolver getEntityResolver()
SAX XMLReader API

getErrorHandler

public ErrorHandler getErrorHandler()
SAX API
Returns:
the error handler if one has been set, else null.

getFeature

public boolean getFeature(String featureURI)
            throws SAXNotRecognizedException,
                   SAXNotSupportedException
SAX API

getParameter

public Object getParameter(String name)
recognizes names in the form "{namespace-part}local-part" as used in TrAX

getParameter

public Object getParameter(Name name)
Specified by:
getParameter in interface ParameterSet

getProperty

public Object getProperty(java.lang.String name)
            throws SAXNotRecognizedException,
                   SAXNotSupportedException
SAX API

handleXSLException

(package private)  void handleXSLException(XSLException e)
            throws SAXException,
                   IOException
rethrows an XSLException as a SAXException

loadStylesheet

public void loadStylesheet(InputSource sheetSource)
            throws SAXException,
                   IOException
load (and compile) the stylesheet
Specified by:
loadStylesheet in interface XSLProcessor

parse

public void parse(InputSource source)
            throws SAXException,
                   IOException
load the input document into a (xslt) object model, and run the transform

parse

public void parse(String sourceURI)
            throws SAXException,
                   IOException
SAX XMLReader API

phase

(package private)  void phase(int n)

setContentHandler

public void setContentHandler(ContentHandler handler)
SAX 2 XMLReader API. we can have either an OutputMethodHandler, or a ContentHandler, not both
Specified by:
setContentHandler in interface XSLProcessor

setDTDHandler

public void setDTDHandler(DTDHandler handler)
SAX XMLReader API

setDebugger

public void setDebugger(String name,
                        ActionDebugTarget debugger)
sets an extension element processor for XRAP
Specified by:
setDebugger in interface XSLProcessor

setEntityResolver

public void setEntityResolver(EntityResolver resolver)
SAX XMLReader API

setErrorHandler

public void setErrorHandler(ErrorHandler handler)
SAX API

setFeature

public void setFeature(String featureURI,
                       boolean value)
            throws SAXNotRecognizedException,
                   SAXNotSupportedException
SAX API

setOutputMethodHandler

public void setOutputMethodHandler(OutputMethodHandler handler)
we can have either an OutputMethodHandler, or a DocumentHandler, not both
Specified by:
setOutputMethodHandler in interface XSLProcessor

setParameter

public void setParameter(String name,
                         Object obj)
recognizes names in the form "{namespace-part}local-part" as used in TrAX
Specified by:
setParameter in interface XSLProcessor

setProperty

public void setProperty(java.lang.String name,
                        java.lang.Object value)
            throws SAXNotRecognizedException,
                   SAXNotSupportedException
SAX API

setReaders

public void setReaders(XMLReader sourceReader,
                       XMLReader sheetReader)
set two XMLReaders (may be the same XMLReader), #1 for parsing the XML source to transform, #2 for parsing the stylesheeet.
Specified by:
setReaders in interface XSLProcessor

setSaxExtensionFilter

public void setSaxExtensionFilter(String name,
                                  SaxFilterMaker xrap)
sets an extension element processor for XRAP
Specified by:
setSaxExtensionFilter in interface XSLProcessor

setSourceReader

public void setSourceReader(XMLReader sourceReader)
prepare for parsing the input XML document
Specified by:
setSourceReader in interface XSLProcessor