ISAXContentHandler::startElement Method
A version of this page is also available for
4/8/2010
This method receives notification of the beginning of an element.
Syntax
HRESULT startElement(
const wchar_t* pwchNamespaceUri,
int cchNamespaceUri,
const wchar_t* pwchLocalName,
int cchLocalName,
const wchar_t* pwchQName,
int cchQName,
ISAXAttributes* pAttributes
);
Parameters
- pwchNamespaceUri
[in] Pointer to the name space URI.
- cchNamespaceUri
[in] Length for the name space URI.
- pwchLocalName
[in] Pointer to the local name string.
- cchLocalName
[in] Length of the local name.
- pwchQName
[in] Pointer to the qualified XML 1.0 name (QName) with prefix or, if QNames are not available, an empty string.
- cchQName
[in] Length of the QName.
- pAttributes
[in] Pointer to the attributes attached to the element.
Return Value
- S_OK
Returned if no errors occur.
- E_FAIL
Returned if the parse operation should be aborted.
Remarks
The reader invokes the startElement method at the beginning of every element in the XML document. A corresponding endElement method is called for every startElement event, even when the element is empty.
The startElement event allows up to three of the following name components for each element:
- Name space URI
- Local name
- QName
Any or all of these name components may be specified, depending on the values of the "https://xml.org/sax/features/namespaces"
and the "https://xml.org/sax/features/namespace-prefixes"
features. The name space URI and local name are required when the "https://xml.org/sax/features/namespaces"
feature is True (the default). These values are optional when this feature is set to False. Note that neither the URI nor local name value can be specified on its own. Both values are required if either is used.
The QName is required when the "https://xml.org/sax/features/namespaces-prefixes feature"
is True and is optional when this feature is False (the default).
Note that the attribute list provided contains only attributes with explicit values (specified or default). The attribute list omits #IMPLIED attributes. Furthermore, the attribute list contains attributes used for name space declarations (xmlns* attributes) only if the "https://xml.org/sax/features/namespace-prefixes"
feature is True. This feature is False by default.
Requirements
Header | msxml2.h, msxml2.idl |
Library | uuid.lib |
Windows Embedded CE | Windows CE .NET 4.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |