Package com.microstrategy.utils.xml
Class SaxToDomHandler
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- com.microstrategy.utils.xml.AbstractHandler
-
- com.microstrategy.utils.xml.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
-
-
Field Summary
-
Fields inherited from class com.microstrategy.utils.xml.AbstractHandler
buf, depth, parser
-
-
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 ofendElement
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 ofstartElement
to process start element event.org.w3c.dom.Document
getDocument()
Returns DOM document.-
Methods inherited from class com.microstrategy.utils.xml.AbstractHandler
characters, clearText, doStartElement, endDocument, endElement, getFloatValue, getIntValue, getText, popContentHandler, setLogErrors, startElement
-
-
-
-
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 attachedrootTag
- a root element tag nameattrs
- 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 ofstartElement
to process start element event. This way you will not have problems with depth counter while subclassing your event handlers.- Overrides:
doStartElement
in classAbstractHandler
- 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 ofendElement
to process end element event. This way you will not have problems with depth counter while subclassing your event handlers.- Specified by:
doEndElement
in classAbstractHandler
- 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
-
-