org.exolab.adaptx.xslt.util

Class StylesheetHandler

public class StylesheetHandler extends ErrorObserverAdapter implements ContentHandler, DocumentHandler

A class which implements a SAX DocumentHandler and ContentHandler and is used by the XSLTReader when reading an XSLT stylesheet.

Version: $Revision: 3936 $ $Date: 2003-10-02 06:03:18 -0400 (Thu, 02 Oct 2003) $

Author: Keith Visco

Constructor Summary
StylesheetHandler()
Creates a new StylesheetHandler
StylesheetHandler(XSLTReader xsltReader)
Creates a new StylesheetHandler using the given XSLReader.
Method Summary
voidcharacters(char[] chars, int start, int length)
Signals the start of characters
voidendDocument()
Signals the end of the document
voidendElement(String name)
Signals the end of an element

DocumentHandler#endElement

voidendElement(String namespaceURI, String localName, String qName)
Signals the end of an element

ContentHandler#endElement

voidendPrefixMapping(String prefix)
Ends the namespace prefix mapping
XSLTStylesheetgetStylesheet()
Return the XSLStylesheet created by this StylesheetHandler
voidignorableWhitespace(char[] chars, int start, int length)
Signals the start of ignorable whitespace characters
voidprocessingInstruction(String target, String data)
Signals to recieve a processing instruction
voidsetDocumentLocator(Locator locator)
Sets the document locator
voidsetURILocation(URILocation location)
Sets the URILocation for the stylesheet being read
voidsetURIResolver(URIResolver resolver)
Sets the URIResolver for this StylesheetHandler
voidskippedEntity(String name)

ContentHandler#skippedEntity

Recieves notification of a skipped entity
voidstartDocument()
Signals the start of a document
voidstartElement(String name, AttributeList atts)
Signals the start of element

DocumentHandler#startElement

voidstartElement(String namespaceURI, String localName, String qName, Attributes attributes)
Signals the start of element

ContentHandler#startElement

voidstartPrefixMapping(String prefix, String uri)
Starts the namespace prefix mapping

Constructor Detail

StylesheetHandler

public StylesheetHandler()
Creates a new StylesheetHandler

StylesheetHandler

public StylesheetHandler(XSLTReader xsltReader)
Creates a new StylesheetHandler using the given XSLReader.

Parameters: xsltReader the XSLTReader to use when reading imported or included stylesheets

Method Detail

characters

public void characters(char[] chars, int start, int length)
Signals the start of characters

Parameters: chars the character array containing the characters to receive start the index into the character array to start receiving characters at length the number of characters to recieve

endDocument

public void endDocument()
Signals the end of the document

endElement

public void endElement(String name)
Signals the end of an element

DocumentHandler#endElement

Parameters: name the name of the element

endElement

public void endElement(String namespaceURI, String localName, String qName)
Signals the end of an element

ContentHandler#endElement

Parameters: namespaceURI the namespace URI of the element localName the unqualified name of the element qName the qualified name of the element

endPrefixMapping

public void endPrefixMapping(String prefix)
Ends the namespace prefix mapping

Parameters: prefix the namespace prefix

getStylesheet

public XSLTStylesheet getStylesheet()
Return the XSLStylesheet created by this StylesheetHandler

Returns: the XSLStylesheet created by this StylesheetHandler

ignorableWhitespace

public void ignorableWhitespace(char[] chars, int start, int length)
Signals the start of ignorable whitespace characters

Parameters: chars the character array containing the characters to receive start the index into the character array to start receiving characters at length the number of characters to recieve

processingInstruction

public void processingInstruction(String target, String data)
Signals to recieve a processing instruction

Parameters: target the target of the processing instruction data the content of the processing instruction

setDocumentLocator

public void setDocumentLocator(Locator locator)
Sets the document locator

Parameters: locator the Locator used by this DocumentHandler

setURILocation

public void setURILocation(URILocation location)
Sets the URILocation for the stylesheet being read

Parameters: location the URILocation for the stylesheet

setURIResolver

public void setURIResolver(URIResolver resolver)
Sets the URIResolver for this StylesheetHandler

Parameters: resolver the URIResolver this StylesheetHandler should use for resolving all URIs.

skippedEntity

public void skippedEntity(String name)

ContentHandler#skippedEntity

Recieves notification of a skipped entity

Parameters: name the name of the skipped entity

startDocument

public void startDocument()
Signals the start of a document

startElement

public void startElement(String name, AttributeList atts)
Signals the start of element

DocumentHandler#startElement

Parameters: name the name of the element atts the AttributeList containing the associated attributes for the element

startElement

public void startElement(String namespaceURI, String localName, String qName, Attributes attributes)
Signals the start of element

ContentHandler#startElement

Parameters: name the name of the element atts the Attributes containing the associated attributes for the element

startPrefixMapping

public void startPrefixMapping(String prefix, String uri)
Starts the namespace prefix mapping

Parameters: prefix the namespace prefix uri the namespace URI