Receiving Documents
In general, a single XMLReader may parse multiple documents and may do so with the same ContentHandler. Consequently, it's important to tell where one document ends and the next document begins. To provide this information, the parser invokes startDocument() as soon as it begins parsing a new document and before it invokes any other methods in ContentHandler. It calls endDocument() after it has finished parsing the document, and it will not report any further content from that document. No arguments are passed to either of these methods, which serve no purpose other than marking the beginning and end of a complete XML document.
Because an XMLReader may parse multiple documents with the same ContentHandler object, per-document ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access