endDocument Method

MSXML 5.0 SDK

Microsoft XML Core Services (MSXML) 5.0 for Microsoft Office - SAX2 Reference

endDocument Method

Receives notification of the end of a document. The reader invokes the endDocument method only once. The endDocument method is the last method invoked during the parse. The reader does not invoke this method until it has either abandoned parsing upon encountering an unrecoverable error or has reached the end of the document.

[Visual Basic]

Implementation Syntax

Sub endDocument()

Usage Syntax

oContentHandler.endDocument

Return Values

If failed, the ContentHandler might raise an exception. This can be any Simple API for XML (SAX) exception. The exception might wrap another exception.

Example

The following example uses the endDocument method to add a line to the current contents of a text box (Text1) on the main application form (Form1). The new text indicates that the reader has finished the document.

Private Sub IVBSAXContentHandler_endDocument()
    Form1.Text1.Text = Form1.Text1.Text & vbCrLf & "Ending document."
End Sub
[C/C++]

Syntax

HRESULT endDocument();

Return Values

S_OK
The value returned if no errors occur.
E_FAIL
The value returned if the parse operation should be aborted.

To view reference information for Visual Basic or C/C++ only, click the Language Filter button Language Filter in the upper-left corner of the page.

See Also

startDocument Method

Applies to: ISAXContentHandler/IVBSAXContentHandler Interface