Partager via


parseURL Method

 

Parses an XML document from a system identifier (URI).

The parseURL method is a shortcut for reading a document from a system identifier. If the system identifier is a URL, the application must fully resolve the URL before passing it to the reader.

Visual Basic Usage Syntax

oSAXXMLReader.parseURL
(strURL)  

Parameters

strURL
The URL to load.

C/C++ Syntax

HRESULT ParseURL(  
   [in] const wchar_t * pwchUrl);  

Parameters

pwchUrl[in]
The URL (zero-terminated Unicode string) to load from.

Return Values

S_OK
The value returned if parsing is successful.

Other
Either the parser error code or the code returned by the custom ErrorHandler. Unresolved URLs, security, and network errors are returned in the same way.

Remarks

Visual Basic

During parsing the reader provides information about the XML document through the registered event handlers. If an error occurs during parsing, the reader calls the appropriate method of the ErrorHandler. The ErrorHandler always returns the internal error code to the parseURL method, even if the ErrorHandler raises a user-defined error.

The base URL and secure base URL can be set by the putBaseURL and putSecureBaseURL methods. These methods are shortcuts for reading a document from a system identifier.

C/C++

During parsing, the reader provides information about the XML document through the registered event handlers. If an error occurs during parsing, the reader calls the appropriate method of the ISAXErrorHandler : IUnknown interface. If the ErrorHandler returns anything but S_OK, parsing is aborted and the parseURL method returns the internal error that stopped the parser. The ErrorHandler always returns the internal error code, even if the ErrorHandler returns a user-defined HRESULT to the parseURL method. The reader can return a number of return codes, including, but not limited to: E_ACCESSDENIED, INET_E_OBJECT_NOT_FOUND, INET_E_DOWNLOAD_FAILURE, MSG_E_BADSTARTNAMECHAR, or MSG_E_MISSINGSEMICOLON.

Versioning

Implemented in: MSXML 3.0 and later

Applies to

ISAXXMLReader Interface

See Also

baseURL Property (Visual Basic)
ISAXErrorHandler Interface
parse Method1
putBaseURL Method (C-C++)
putSecureBaseURL Method (C-C++)
secureBaseURL Property (Visual Basic)