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 TypeMethodDescriptionvoid
close()
Triggered when parsing is finished and the stream will be closed.void
Triggered for comments that are found.void
endElement
(String tag, String ns) Triggered on a closing tag.void
init()
Triggered when parsing has started.void
Triggered on an opening tag.void
Called when text is encountered.void
unknownText
(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
-