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,org.xml.sax.ContentHandler,org.xml.sax.DocumentHandler
- Direct Known Subclasses:
TemplatesHandlerImpl
public class StylesheetHandler extends ErrorObserverAdapter implements org.xml.sax.ContentHandler, org.xml.sax.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
Constructors Constructor Description StylesheetHandler()Creates a new StylesheetHandlerStylesheetHandler(XSLTReader xsltReader)Creates a new StylesheetHandler using the given XSLReader.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcharacters(char[] chars, int start, int length)Signals the start of charactersvoidendDocument()Signals the end of the documentvoidendElement(java.lang.String name)Signals the end of an elementvoidendElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)Signals the end of an elementvoidendPrefixMapping(java.lang.String prefix)Ends the namespace prefix mappingXSLTStylesheetgetStylesheet()Return the XSLStylesheet created by this StylesheetHandlervoidignorableWhitespace(char[] chars, int start, int length)Signals the start of ignorable whitespace charactersvoidprocessingInstruction(java.lang.String target, java.lang.String data)Signals to recieve a processing instructionvoidsetDocumentLocator(org.xml.sax.Locator locator)Sets the document locatorvoidsetURILocation(URILocation location)Sets the URILocation for the stylesheet being readvoidsetURIResolver(URIResolver resolver)Sets the URIResolver for this StylesheetHandlervoidskippedEntity(java.lang.String name)ContentHandler#skippedEntityvoidstartDocument()Signals the start of a documentvoidstartElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)Signals the start of elementvoidstartElement(java.lang.String name, org.xml.sax.AttributeList atts)Signals the start of elementvoidstartPrefixMapping(java.lang.String prefix, java.lang.String uri)Starts the namespace prefix mapping-
Methods inherited from class org.exolab.adaptx.util.ErrorObserverAdapter
addErrorObserver, receiveError, receiveError, receiveError, receiveError, receiveError, receiveError, removeAllErrorObservers, removeErrorObserver
-
-
-
-
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
-
getStylesheet
public XSLTStylesheet getStylesheet()
Return the XSLStylesheet created by this StylesheetHandler- Returns:
- the XSLStylesheet created by this StylesheetHandler
-
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.
-
characters
public void characters(char[] chars, int start, int length) throws org.xml.sax.SAXExceptionSignals the start of characters- Specified by:
charactersin interfaceorg.xml.sax.ContentHandler- Specified by:
charactersin interfaceorg.xml.sax.DocumentHandler- 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:
org.xml.sax.SAXException
-
endDocument
public void endDocument() throws org.xml.sax.SAXExceptionSignals the end of the document- Specified by:
endDocumentin interfaceorg.xml.sax.ContentHandler- Specified by:
endDocumentin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String name) throws org.xml.sax.SAXExceptionSignals the end of an elementDocumentHandler#endElement
- Specified by:
endElementin interfaceorg.xml.sax.DocumentHandler- Parameters:
name- the name of the element- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName) throws org.xml.sax.SAXExceptionSignals the end of an elementContentHandler#endElement
- Specified by:
endElementin interfaceorg.xml.sax.ContentHandler- Parameters:
namespaceURI- the namespace URI of the elementlocalName- the unqualified name of the elementqName- the qualified name of the element- Throws:
org.xml.sax.SAXException
-
endPrefixMapping
public void endPrefixMapping(java.lang.String prefix) throws org.xml.sax.SAXExceptionEnds the namespace prefix mapping- Specified by:
endPrefixMappingin interfaceorg.xml.sax.ContentHandler- Parameters:
prefix- the namespace prefix- Throws:
org.xml.sax.SAXException
-
ignorableWhitespace
public void ignorableWhitespace(char[] chars, int start, int length) throws org.xml.sax.SAXExceptionSignals the start of ignorable whitespace characters- Specified by:
ignorableWhitespacein interfaceorg.xml.sax.ContentHandler- Specified by:
ignorableWhitespacein interfaceorg.xml.sax.DocumentHandler- 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:
org.xml.sax.SAXException
-
processingInstruction
public void processingInstruction(java.lang.String target, java.lang.String data) throws org.xml.sax.SAXExceptionSignals to recieve a processing instruction- Specified by:
processingInstructionin interfaceorg.xml.sax.ContentHandler- Specified by:
processingInstructionin interfaceorg.xml.sax.DocumentHandler- Parameters:
target- the target of the processing instructiondata- the content of the processing instruction- Throws:
org.xml.sax.SAXException
-
setDocumentLocator
public void setDocumentLocator(org.xml.sax.Locator locator)
Sets the document locator- Specified by:
setDocumentLocatorin interfaceorg.xml.sax.ContentHandler- Specified by:
setDocumentLocatorin interfaceorg.xml.sax.DocumentHandler- Parameters:
locator- the Locator used by this DocumentHandler
-
skippedEntity
public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXExceptionContentHandler#skippedEntity
Recieves notification of a skipped entity- Specified by:
skippedEntityin interfaceorg.xml.sax.ContentHandler- Parameters:
name- the name of the skipped entity- Throws:
org.xml.sax.SAXException
-
startDocument
public void startDocument() throws org.xml.sax.SAXExceptionSignals the start of a document- Specified by:
startDocumentin interfaceorg.xml.sax.ContentHandler- Specified by:
startDocumentin interfaceorg.xml.sax.DocumentHandler- Throws:
org.xml.sax.SAXException
-
startElement
public void startElement(java.lang.String name, org.xml.sax.AttributeList atts) throws org.xml.sax.SAXExceptionSignals the start of elementDocumentHandler#startElement
- Specified by:
startElementin interfaceorg.xml.sax.DocumentHandler- Parameters:
name- the name of the elementatts- the AttributeList containing the associated attributes for the element- Throws:
org.xml.sax.SAXException
-
startElement
public void startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes) throws org.xml.sax.SAXExceptionSignals the start of elementContentHandler#startElement
- Specified by:
startElementin interfaceorg.xml.sax.ContentHandler- Parameters:
name- the name of the elementatts- the Attributes containing the associated attributes for the element- Throws:
org.xml.sax.SAXException
-
startPrefixMapping
public void startPrefixMapping(java.lang.String prefix, java.lang.String uri) throws org.xml.sax.SAXExceptionStarts the namespace prefix mapping- Specified by:
startPrefixMappingin interfaceorg.xml.sax.ContentHandler- Parameters:
prefix- the namespace prefixuri- the namespace URI- Throws:
org.xml.sax.SAXException
-
-