com.jclark.xsl.sax2

Interface XSLProcessor

All Superinterfaces:
XMLReader
Known Implementing Classes:
XSLProcessorImpl

public interface XSLProcessor
extends XMLReader

typical usage:
// find an implementation, and construct it
XSLProcessor xsl = new XSLProcessorImpl();
xsl.setReaders(sourceXMLReader, styleXMLReader);
xsl.loadStylesheet(someInputSource);
// maybe clone for re-use ...
XSLProcessor nextTime = xsl.clone();
// maybe set some parameters ...
// attach an output handler
xsl.setContentHandler(someHandler);
xsl.transform(someOtherInputSource);

Method Summary

Object
clone()
clone after loadStylesheet() enables us to re-use a transformer, without recompiling the stylesheet
void
loadStylesheet(InputSource stylesheet)
loadStylesheet must be called before parse but after setParser
void
setContentHandler(ContentHandler handler)
set the output target for the transform.
void
setDebugger(String name, ActionDebugTarget xrap)
sets a special kind of extension element processor N.B.
void
setOutputMethodHandler(OutputMethodHandler handler)
set the output target for the transform.
void
setParameter(String name, Object obj)
set the run-time parameters for the stylesheet
void
setReaders(XMLReader sourceReader, XMLReader stylesheetReader)
set one parser for the stylesheet, and another for the input
void
setSaxExtensionFilter(String name, SaxFilterMaker xrap)
sets a special kind of extension element processor N.B.
void
setSourceReader(XMLReader sourceReader)
prepare for parsing the input XML document

Method Details

clone

public Object clone()
clone after loadStylesheet() enables us to re-use a transformer, without recompiling the stylesheet


loadStylesheet

public void loadStylesheet(InputSource stylesheet)
            throws IOException,
                   SAXException
loadStylesheet must be called before parse but after setParser


setContentHandler

public void setContentHandler(ContentHandler handler)
set the output target for the transform. Choose one of setOutputMethodHandler() or setContentHandler()


setDebugger

public void setDebugger(String name,
                        ActionDebugTarget xrap)
sets a special kind of extension element processor N.B. this signature will probably change in future releases


setOutputMethodHandler

public void setOutputMethodHandler(OutputMethodHandler handler)
set the output target for the transform. Choose one of setOutputMethodHandler() or setContentHandler()


setParameter

public void setParameter(String name,
                         Object obj)
set the run-time parameters for the stylesheet


setReaders

public void setReaders(XMLReader sourceReader,
                       XMLReader stylesheetReader)
set one parser for the stylesheet, and another for the input


setSaxExtensionFilter

public void setSaxExtensionFilter(String name,
                                  SaxFilterMaker xrap)
sets a special kind of extension element processor N.B. this signature will probably change in future releases


setSourceReader

public void setSourceReader(XMLReader sourceReader)
prepare for parsing the input XML document