skippedEntity Method

MSXML 5.0 SDK

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

skippedEntity Method

Receives notification of a skipped entity. The skippedEntity method is invoked for each entity skipped. The reader may skip entities if they have not been seen in the declarations. An example of this is when an entity is declared in an external DTD subset. The reader may skip external entities, depending on the values of the "http://xml.org/sax/features/external-general-entities" and "http://xml.org/sax/features/external-parameter-entities" features.

The skippedEntity method is also called in the case of an external DTD declaration. For example:

<!DOCTYPE xyz SYSTEM "http://…">
[Visual Basic]

Implementation Syntax

Sub skippedEntity(strName As String)

Parameters

strName
The name of the skipped entity. If the entity is a parameter entity, the name begins with '%'.

Return Values

If failed, the ContentHandler raises a trappable error.

Example

The following example shows how to use the skippedEntity method to pass log event information to a text box (Text2) on a form (Form1). This informs the user that entity references in the document were skipped and not resolved by the reader during parsing.

Private Sub IVBSAXContentHandler_skippedEntity(strName As String)
    Dim msg As String
    Select Case strName
        Case "[dtd]"
            msg = "Reference to external DTD skipped." & vbCrLf
        Case Else
            msg = "Entity reference {" & strName & "} skipped." & vbCrLf
    End Select
    Form1.Text2.Text = Form1.Text2.Text & msg
End Sub
[C/C++]

Syntax

HRESULT skippedEntity(
   [in] const wchar_t * pwchName,
   [in] int cchName);

Parameters

pwchName [in]
The name of the skipped entity. If the entity is a parameter entity, the name begins with '%'.
cchName [in]
The number of characters in the pwchName string.

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

putFeature Method

Applies to: ISAXContentHandler/IVBSAXContentHandler Interface