|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.itextpdf.text.xml.XmlToTxt
public class XmlToTxt
This class converts XML into plain text stripping all tags.
| Field Summary | |
|---|---|
protected StringBuffer |
buf
Buffer that stores all content that is encountered. |
| Constructor Summary | |
|---|---|
protected |
XmlToTxt()
Creates an instance of XML to TXT. |
| Method Summary | |
|---|---|
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()
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected StringBuffer buf
| Constructor Detail |
|---|
protected XmlToTxt()
| Method Detail |
|---|
public static String parse(InputStream is)
throws IOException
is - the XML input that needs to be parsed
IOExceptionpublic String toString()
toString in class Object
public void startElement(String tag,
Map<String,String> h)
SimpleXMLDocHandler
startElement in interface SimpleXMLDocHandlertag - the tag nameh - the tag's attributesSimpleXMLDocHandler.startElement(java.lang.String, java.util.Map)public void endElement(String tag)
SimpleXMLDocHandler
endElement in interface SimpleXMLDocHandlertag - the tag nameSimpleXMLDocHandler.endElement(java.lang.String)public void startDocument()
SimpleXMLDocHandler
startDocument in interface SimpleXMLDocHandlerSimpleXMLDocHandler.startDocument()public void endDocument()
SimpleXMLDocHandler
endDocument in interface SimpleXMLDocHandlerSimpleXMLDocHandler.endDocument()public void text(String str)
SimpleXMLDocHandler
text in interface SimpleXMLDocHandlerstr - the text element, probably a fragment.SimpleXMLDocHandler.text(java.lang.String)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||