Share via


resolveEntity Method1

 

Allows the parser to resolve external entities.

Visual Basic Implementation Syntax

Function resolveEntity(strPublicId As String, strSystemId As String)  

Parameters

strPublicId
The public identifier of the external entity being referenced, or Null (if none was supplied).

strSystemId
The system identifier of the external entity being referenced.

C/C++ Syntax

HRESULT resolveEntity(  
   [in] const wchar_t * pwchPublicId,  
   [in] const wchar_t * pwchSystemId,  
   [out,retval] VARIANT * pvarInput);  

Parameters

pwchPublicId[in]
The public identifier of the external entity being referenced, or Null (if none was supplied).

pwchSystemId [in]
The system identifier of the external entity being referenced.

pvarInput [out, retval]
The returned text of the entity. Acceptable input types are the same as for the parse method.

Return Values

S_OK
The value returned if no errors are reported.

E_FAIL
The value returned if the parse operation should be aborted.

Remarks

Allow the application to resolve external entities.

When ISAXEntityResolver or IVBSAXEntityResolver is implemented, the SAX reader will call this method before opening any external entity except the top-level document entity. External entities handled by this method can include the following: the external DTD subset, external entities referenced within the DTD, and external entities referenced within the document element. The application can request that the parser resolve the entity itself, that it use an alternative URI, or that it use an entirely different input source.

Application writers can use the resolveEntity method to perform the following tasks:

  • To redirect external system identifiers to secure and/or local URIs.

  • To look up public identifiers in a catalogue.

  • To read an entity from a database or other input source—for example, a dialog box.

If the system identifier is a URL, the SAX reader must resolve it fully before reporting it to the application.

Note

For this method, the Java implementation requires the InputSource interface, which is not included in this implementation. Instead, variant is used as the data type for method output. Output currently can represent be either a binary stream (IStream) or, potentially, string data. User feedback is appreciated during prerelease. If important usage cases are found, InputSource might be included in future releases.

Versioning

Implemented in: MSXML 3.0 and later

Applies to

ISAXEntityResolver Interface

See Also

parse Method1
unparsedEntityDecl Method