Package com.microstrategy.utils.xml
Class SAXXMLStringDumper
- java.lang.Object
-
- org.xml.sax.helpers.DefaultHandler
-
- com.microstrategy.utils.xml.AbstractHandler
-
- com.microstrategy.utils.xml.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 stringsomething . 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
-
-
Field Summary
Fields Modifier and Type Field Description protected XMLBuilder
xb
-
Fields inherited from class com.microstrategy.utils.xml.AbstractHandler
buf, depth, parser
-
-
Constructor Summary
Constructors Constructor Description SAXXMLStringDumper()
SAXXMLStringDumper(SAXSupport pParser)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTopLevelNode(java.lang.String local, org.xml.sax.Attributes attrs)
void
characters(char[] ch, int start, int length)
void
clearBuffer()
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
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.void
endTopLevelNode()
protected XMLBuilder
getBuilder()
java.lang.String
getString()
-
Methods inherited from class com.microstrategy.utils.xml.AbstractHandler
clearText, doStartElement, endDocument, endElement, getFloatValue, getIntValue, getText, popContentHandler, setLogErrors, startElement
-
-
-
-
Field Detail
-
xb
protected XMLBuilder xb
-
-
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 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
-
characters
public void characters(char[] ch, int start, int length) throws org.xml.sax.SAXException
- Specified by:
characters
in interfaceorg.xml.sax.ContentHandler
- Overrides:
characters
in classAbstractHandler
- 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()
-
getBuilder
protected XMLBuilder getBuilder()
-
clearBuffer
public void clearBuffer()
-
-