Package org.exolab.adaptx.xslt.util
Class StylesheetHandler
java.lang.Object
org.exolab.adaptx.util.ErrorObserverAdapter
org.exolab.adaptx.xslt.util.StylesheetHandler
- All Implemented Interfaces:
ErrorObserver
,ContentHandler
,DocumentHandler
- Direct Known Subclasses:
TemplatesHandlerImpl
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 12:03:18 +0200 (Thu, 02 Oct 2003) $
- Author:
- Keith Visco
-
Field Summary
Fields inherited from interface org.exolab.adaptx.util.ErrorObserver
FATAL, NORMAL, WARNING
-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new StylesheetHandlerStylesheetHandler
(XSLTReader xsltReader) Creates a new StylesheetHandler using the given XSLReader. -
Method Summary
Modifier and TypeMethodDescriptionvoid
characters
(char[] chars, int start, int length) Signals the start of charactersvoid
Signals the end of the documentvoid
endElement
(String name) Signals the end of an elementvoid
endElement
(String namespaceURI, String localName, String qName) Signals the end of an elementvoid
endPrefixMapping
(String prefix) Ends the namespace prefix mappingReturn the XSLStylesheet created by this StylesheetHandlervoid
ignorableWhitespace
(char[] chars, int start, int length) Signals the start of ignorable whitespace charactersvoid
processingInstruction
(String target, String data) Signals to recieve a processing instructionvoid
setDocumentLocator
(Locator locator) Sets the document locatorvoid
setURILocation
(URILocation location) Sets the URILocation for the stylesheet being readvoid
setURIResolver
(URIResolver resolver) Sets the URIResolver for this StylesheetHandlervoid
skippedEntity
(String name) ContentHandler#skippedEntityvoid
Signals the start of a documentvoid
startElement
(String namespaceURI, String localName, String qName, Attributes attributes) Signals the start of elementvoid
startElement
(String name, AttributeList atts) Signals the start of elementvoid
startPrefixMapping
(String prefix, String uri) Starts the namespace prefix mappingMethods inherited from class org.exolab.adaptx.util.ErrorObserverAdapter
addErrorObserver, receiveError, receiveError, receiveError, receiveError, receiveError, receiveError, removeAllErrorObservers, removeErrorObserver
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.xml.sax.ContentHandler
declaration
-
Constructor Details
-
StylesheetHandler
public StylesheetHandler()Creates a new StylesheetHandler -
StylesheetHandler
Creates a new StylesheetHandler using the given XSLReader.- Parameters:
xsltReader
- the XSLTReader to use when reading imported or included stylesheets
-
-
Method Details
-
getStylesheet
Return the XSLStylesheet created by this StylesheetHandler- Returns:
- the XSLStylesheet created by this StylesheetHandler
-
setURILocation
Sets the URILocation for the stylesheet being read- Parameters:
location
- the URILocation for the stylesheet
-
setURIResolver
Sets the URIResolver for this StylesheetHandler- Parameters:
resolver
- the URIResolver this StylesheetHandler should use for resolving all URIs.
-
characters
Signals the start of characters- Specified by:
characters
in interfaceContentHandler
- Specified by:
characters
in interfaceDocumentHandler
- Parameters:
chars
- the character array containing the characters to receivestart
- the index into the character array to start receiving characters atlength
- the number of characters to recieve- Throws:
SAXException
-
endDocument
Signals the end of the document- Specified by:
endDocument
in interfaceContentHandler
- Specified by:
endDocument
in interfaceDocumentHandler
- Throws:
SAXException
-
endElement
Signals the end of an elementDocumentHandler#endElement
- Specified by:
endElement
in interfaceDocumentHandler
- Parameters:
name
- the name of the element- Throws:
SAXException
-
endElement
Signals the end of an elementContentHandler#endElement
- Specified by:
endElement
in interfaceContentHandler
- Parameters:
namespaceURI
- the namespace URI of the elementlocalName
- the unqualified name of the elementqName
- the qualified name of the element- Throws:
SAXException
-
endPrefixMapping
Ends the namespace prefix mapping- Specified by:
endPrefixMapping
in interfaceContentHandler
- Parameters:
prefix
- the namespace prefix- Throws:
SAXException
-
ignorableWhitespace
Signals the start of ignorable whitespace characters- Specified by:
ignorableWhitespace
in interfaceContentHandler
- Specified by:
ignorableWhitespace
in interfaceDocumentHandler
- Parameters:
chars
- the character array containing the characters to receivestart
- the index into the character array to start receiving characters atlength
- the number of characters to recieve- Throws:
SAXException
-
processingInstruction
Signals to recieve a processing instruction- Specified by:
processingInstruction
in interfaceContentHandler
- Specified by:
processingInstruction
in interfaceDocumentHandler
- Parameters:
target
- the target of the processing instructiondata
- the content of the processing instruction- Throws:
SAXException
-
setDocumentLocator
Sets the document locator- Specified by:
setDocumentLocator
in interfaceContentHandler
- Specified by:
setDocumentLocator
in interfaceDocumentHandler
- Parameters:
locator
- the Locator used by this DocumentHandler
-
skippedEntity
ContentHandler#skippedEntity
Recieves notification of a skipped entity- Specified by:
skippedEntity
in interfaceContentHandler
- Parameters:
name
- the name of the skipped entity- Throws:
SAXException
-
startDocument
Signals the start of a document- Specified by:
startDocument
in interfaceContentHandler
- Specified by:
startDocument
in interfaceDocumentHandler
- Throws:
SAXException
-
startElement
Signals the start of elementDocumentHandler#startElement
- Specified by:
startElement
in interfaceDocumentHandler
- Parameters:
name
- the name of the elementatts
- the AttributeList containing the associated attributes for the element- Throws:
SAXException
-
startElement
public void startElement(String namespaceURI, String localName, String qName, Attributes attributes) throws SAXException Signals the start of elementContentHandler#startElement
- Specified by:
startElement
in interfaceContentHandler
- Parameters:
name
- the name of the elementatts
- the Attributes containing the associated attributes for the element- Throws:
SAXException
-
startPrefixMapping
Starts the namespace prefix mapping- Specified by:
startPrefixMapping
in interfaceContentHandler
- Parameters:
prefix
- the namespace prefixuri
- the namespace URI- Throws:
SAXException
-