Package com.itextpdf.tool.xml.parser
Interface XMLParserListener
- All Known Implementing Classes:
ParserListenerWriter,XMLWorker
public interface XMLParserListener
Can be added to the
XMLParser to receive events.-
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Triggered when parsing is finished and the stream will be closed.voidTriggered for comments that are found.voidendElement(String tag, String ns) Triggered on a closing tag.voidinit()Triggered when parsing has started.voidTriggered on an opening tag.voidCalled when text is encountered.voidunknownText(String text) Triggered for text found outside root tag.
-
Method Details
-
startElement
Triggered on an opening tag.- Parameters:
tag- the tag of the elementattributes- the attributes found on the tagns- the namespace or empty String
-
endElement
Triggered on a closing tag.- Parameters:
tag- the tagns- the namespace or empty String
-
unknownText
Triggered for text found outside root tag.- Parameters:
text- the text
-
comment
Triggered for comments that are found.- Parameters:
comment- the comment
-
init
void init()Triggered when parsing has started. -
close
void close()Triggered when parsing is finished and the stream will be closed. -
text
Called when text is encountered.- Parameters:
text- the text
-