Class SaxToDomHandler

  • All Implemented Interfaces:
    org.xml.sax.ContentHandler, org.xml.sax.DTDHandler, org.xml.sax.EntityResolver, org.xml.sax.ErrorHandler

    public class SaxToDomHandler
    extends AbstractHandler
    A class that converts an XML subtree into DOM document
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Constructor Summary

      Constructors 
      Constructor Description
      SaxToDomHandler​(SAXSupport pParser)
      This constructor shall be called when parsing starts at the object's parent node.
      SaxToDomHandler​(SAXSupport pParser, java.lang.String rootTag, org.xml.sax.Attributes attrs)
      This constructor shall be called when parsing starts at the object's mi node.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      protected void doEndElement​(java.lang.String uri, java.lang.String local, java.lang.String qName)
      Override this method insted of endElement to process end element event.
      protected void domIsReady()
      Override this method to process DOM is ready event.
      protected void doStartElement​(java.lang.String uri, java.lang.String local, java.lang.String qName, org.xml.sax.Attributes attrs)
      Override this method insted of startElement to process start element event.
      org.w3c.dom.Document getDocument()
      Returns DOM document.
      • Methods inherited from class org.xml.sax.helpers.DefaultHandler

        endPrefixMapping, error, fatalError, ignorableWhitespace, notationDecl, processingInstruction, resolveEntity, setDocumentLocator, skippedEntity, startDocument, startPrefixMapping, unparsedEntityDecl, warning
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • SaxToDomHandler

        public SaxToDomHandler​(SAXSupport pParser,
                               java.lang.String rootTag,
                               org.xml.sax.Attributes attrs)
                        throws org.xml.sax.SAXException
        This constructor shall be called when parsing starts at the object's mi node.
        Parameters:
        pParser - a SAX parser to which this handler needs to be attached
        rootTag - a root element tag name
        attrs - a root element attributes
        Throws:
        org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception
      • SaxToDomHandler

        public SaxToDomHandler​(SAXSupport pParser)
                        throws org.xml.sax.SAXException
        This constructor shall be called when parsing starts at the object's parent node.
        Parameters:
        pParser - - a SAX parser to which this handler needs to be attached
        Throws:
        org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception
    • Method Detail

      • getDocument

        public org.w3c.dom.Document getDocument()
        Returns DOM document. This message shall be called after the DOM is ready event happened.
        Returns:
        DOM document
      • doStartElement

        protected void doStartElement​(java.lang.String uri,
                                      java.lang.String local,
                                      java.lang.String qName,
                                      org.xml.sax.Attributes attrs)
                               throws org.xml.sax.SAXException
        Description copied from class: AbstractHandler
        Override this method insted of startElement to process start element event. This way you will not have problems with depth counter while subclassing your event handlers.
        Overrides:
        doStartElement in class AbstractHandler
        Throws:
        org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception
      • doEndElement

        protected void doEndElement​(java.lang.String uri,
                                    java.lang.String local,
                                    java.lang.String qName)
                             throws org.xml.sax.SAXException
        Description copied from class: AbstractHandler
        Override this method insted of endElement to process end element event. This way you will not have problems with depth counter while subclassing your event handlers.
        Specified by:
        doEndElement in class AbstractHandler
        Throws:
        org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception
      • domIsReady

        protected void domIsReady()
                           throws org.xml.sax.SAXException
        Override this method to process DOM is ready event.
        Throws:
        org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception