ISAXXMLReader::parse Method (Windows CE 5.0)
This method parses an XML document.
HRESULT parse(VARIANTvarInput);
Parameters
- varInput
[in] Variant containing the input source to parse from. See Remarks for supported VARIANT types.
Return Values
- S_OK
Returned if parsing is successful. - E_INVALIDARG
Returned if varInput is not a recognized input source. - Other
Parser error code or the code returned by the custom error handler.
Remarks
The application can use this method to instruct the reader to begin parsing a document from a variety of sources. Supported VARIANT types are VT_BSTR
, SafeArray of bytes (VT_ARRAYVT_UI1
), VT_UNK(IStream)
, and VT_UNK(ISequentialStream)
. One-level referencing is also permitted.
VT_BYREF | VT_VARIANT d
VT_BYREF | VT_VARIANT -> VT_BSTR
VT_BYREF | VT_VARIANT -> IStream
VT_BYREF | VT_VARIANT -> VT_ARRAY|VT_UI1
An application cannot invoke this method while parsing is in progress. Instead, it should create a new instance of the reader for each nested XML document. After parsing is complete, an application can reuse the same reader object, possibly with a different input source.
While 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 interface. If the error handler returns anything but S_OK, parsing is aborted and the parse method returns the internal error that stopped the parser. Note that the error handler always returns the internal error code, even if the error handler returns a user-defined HRESULT to the parse 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.
Requirements
OS Versions: Windows CE .NET 4.0 and later.
Header: Msxml2.h, Msxml2.idl.
Link Library: Uuid.lib.
See Also
putEntityResolver Method | putDTDHandler Method | putContentHandler Method | putErrorHandler Method | ISAXXMLReader:IUnknown Interface
Send Feedback on this topic to the authors