public class XmlToTxt extends Object implements SimpleXMLDocHandler
Modifier and Type | Field and Description |
---|---|
protected StringBuffer |
buf
Buffer that stores all content that is encountered.
|
Modifier | Constructor and Description |
---|---|
protected |
XmlToTxt()
Creates an instance of XML to TXT.
|
Modifier and Type | Method and Description |
---|---|
void |
endDocument()
Called after the document is parsed.
|
void |
endElement(String tag)
Called when an end tag is found.
|
static String |
parse(InputStream is)
Static method that parses an XML InputStream.
|
void |
startDocument()
Called when the document starts to be parsed.
|
void |
startElement(String tag, Map<String,String> h)
Called when a start tag is found.
|
void |
text(String str)
Called when a text element is found.
|
String |
toString() |
protected StringBuffer buf
public static String parse(InputStream is) throws IOException
is
- the XML input that needs to be parsed
IOException
public String toString()
public void startElement(String tag, Map<String,String> h)
SimpleXMLDocHandler
startElement
in interface SimpleXMLDocHandler
tag
- the tag name
h
- the tag's attributes
SimpleXMLDocHandler.startElement(java.lang.String, java.util.Map)
public void endElement(String tag)
SimpleXMLDocHandler
endElement
in interface SimpleXMLDocHandler
tag
- the tag name
SimpleXMLDocHandler.endElement(java.lang.String)
public void startDocument()
SimpleXMLDocHandler
startDocument
in interface SimpleXMLDocHandler
SimpleXMLDocHandler.startDocument()
public void endDocument()
SimpleXMLDocHandler
endDocument
in interface SimpleXMLDocHandler
SimpleXMLDocHandler.endDocument()
public void text(String str)
SimpleXMLDocHandler
text
in interface SimpleXMLDocHandler
str
- the text element, probably a fragment.
SimpleXMLDocHandler.text(java.lang.String)
Copyright © 1998–2018. All rights reserved.