Class 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
    • 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 interface org.xml.sax.ContentHandler
        Specified by:
        characters in interface org.xml.sax.DocumentHandler
        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
        Throws:
        org.xml.sax.SAXException
      • endDocument

        public void endDocument()
                         throws org.xml.sax.SAXException
        Signals the end of the document
        Specified by:
        endDocument in interface org.xml.sax.ContentHandler
        Specified by:
        endDocument in interface org.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 element

        DocumentHandler#endElement

        Specified by:
        endElement in interface org.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 element

        ContentHandler#endElement

        Specified by:
        endElement in interface org.xml.sax.ContentHandler
        Parameters:
        namespaceURI - the namespace URI of the element
        localName - the unqualified name of the element
        qName - 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 interface org.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 interface org.xml.sax.ContentHandler
        Specified by:
        ignorableWhitespace in interface org.xml.sax.DocumentHandler
        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
        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 interface org.xml.sax.ContentHandler
        Specified by:
        processingInstruction in interface org.xml.sax.DocumentHandler
        Parameters:
        target - the target of the processing instruction
        data - 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 interface org.xml.sax.ContentHandler
        Specified by:
        setDocumentLocator in interface org.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 interface org.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 interface org.xml.sax.ContentHandler
        Specified by:
        startDocument in interface org.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 element

        DocumentHandler#startElement

        Specified by:
        startElement in interface org.xml.sax.DocumentHandler
        Parameters:
        name - the name of the element
        atts - 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 element

        ContentHandler#startElement

        Specified by:
        startElement in interface org.xml.sax.ContentHandler
        Parameters:
        name - the name of the element
        atts - 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 interface org.xml.sax.ContentHandler
        Parameters:
        prefix - the namespace prefix
        uri - the namespace URI
        Throws:
        org.xml.sax.SAXException