Class SAXXMLStringDumper

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

    public class SAXXMLStringDumper
    extends AbstractHandler
    This class helps extract a valid XML string embedded inside another xml. for instance, you could extract something from the string something. Note that this handler would not work if the substring to be extracted is not valid XML
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Constructor Detail

      • SAXXMLStringDumper

        public SAXXMLStringDumper()
      • SAXXMLStringDumper

        public SAXXMLStringDumper​(SAXSupport pParser)
    • Method Detail

      • addTopLevelNode

        public void addTopLevelNode​(java.lang.String local,
                                    org.xml.sax.Attributes attrs)
                             throws org.xml.sax.SAXException
        Throws:
        org.xml.sax.SAXException
      • endTopLevelNode

        public void endTopLevelNode()
      • 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
      • characters

        public void characters​(char[] ch,
                               int start,
                               int length)
                        throws org.xml.sax.SAXException
        Specified by:
        characters in interface org.xml.sax.ContentHandler
        Overrides:
        characters in class AbstractHandler
        Parameters:
        ch - The characters.
        start - The start position in the character array.
        length - The number of characters to use from the character array.
        Throws:
        org.xml.sax.SAXException - Any SAX exception, possibly wrapping another exception.
        See Also:
        ContentHandler.characters(char[], int, int)
      • getString

        public java.lang.String getString()
      • clearBuffer

        public void clearBuffer()