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 void
characters(char[] chars, int start, int length)
Signals the start of charactersvoid
endDocument()
Signals the end of the documentvoid
endElement(java.lang.String name)
Signals the end of an elementvoid
endElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName)
Signals the end of an elementvoid
endPrefixMapping(java.lang.String prefix)
Ends the namespace prefix mappingXSLTStylesheet
getStylesheet()
Return the XSLStylesheet created by this StylesheetHandlervoid
ignorableWhitespace(char[] chars, int start, int length)
Signals the start of ignorable whitespace charactersvoid
processingInstruction(java.lang.String target, java.lang.String data)
Signals to recieve a processing instructionvoid
setDocumentLocator(org.xml.sax.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(java.lang.String name)
ContentHandler#skippedEntityvoid
startDocument()
Signals the start of a documentvoid
startElement(java.lang.String namespaceURI, java.lang.String localName, java.lang.String qName, org.xml.sax.Attributes attributes)
Signals the start of elementvoid
startElement(java.lang.String name, org.xml.sax.AttributeList atts)
Signals the start of elementvoid
startPrefixMapping(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.SAXException
Signals the start of characters- Specified by:
characters
in interfaceorg.xml.sax.ContentHandler
- Specified by:
characters
in 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.SAXException
Signals the end of the document- Specified by:
endDocument
in interfaceorg.xml.sax.ContentHandler
- Specified by:
endDocument
in interfaceorg.xml.sax.DocumentHandler
- Throws:
org.xml.sax.SAXException
-
endElement
public void endElement(java.lang.String name) throws org.xml.sax.SAXException
Signals the end of an elementDocumentHandler#endElement
- Specified by:
endElement
in 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.SAXException
Signals the end of an elementContentHandler#endElement
- Specified by:
endElement
in 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.SAXException
Ends the namespace prefix mapping- Specified by:
endPrefixMapping
in 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.SAXException
Signals the start of ignorable whitespace characters- Specified by:
ignorableWhitespace
in interfaceorg.xml.sax.ContentHandler
- Specified by:
ignorableWhitespace
in 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.SAXException
Signals to recieve a processing instruction- Specified by:
processingInstruction
in interfaceorg.xml.sax.ContentHandler
- Specified by:
processingInstruction
in 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:
setDocumentLocator
in interfaceorg.xml.sax.ContentHandler
- Specified by:
setDocumentLocator
in interfaceorg.xml.sax.DocumentHandler
- Parameters:
locator
- the Locator used by this DocumentHandler
-
skippedEntity
public void skippedEntity(java.lang.String name) throws org.xml.sax.SAXException
ContentHandler#skippedEntity
Recieves notification of a skipped entity- Specified by:
skippedEntity
in 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.SAXException
Signals the start of a document- Specified by:
startDocument
in interfaceorg.xml.sax.ContentHandler
- Specified by:
startDocument
in 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.SAXException
Signals the start of elementDocumentHandler#startElement
- Specified by:
startElement
in 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.SAXException
Signals the start of elementContentHandler#startElement
- Specified by:
startElement
in 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.SAXException
Starts the namespace prefix mapping- Specified by:
startPrefixMapping
in interfaceorg.xml.sax.ContentHandler
- Parameters:
prefix
- the namespace prefixuri
- the namespace URI- Throws:
org.xml.sax.SAXException
-
-