Receives notification of the beginning of an element. 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
method, even when the element is empty.
Sub startElement(strNamespaceURI As String, strLocalName As String,_ strQName As String, oAttributes As IVBSAXAttributes)
oContentHandler.startElement "xsl", "stylesheet", "xsl:stylesheet", _ oAttributes
If failed, the ContentHandler
raises a trappable error.
The following example uses the startElement
method to set the text property for a text box (Text1) on the main application form (Form1). The new text indicates that the reader has begun reading the current element.
Private Sub IVBSAXContentHandler_startElement(strNamespaceURI As _ String, strLocalName As String, strQName As String, _ oAttributes As IVBSAXAttributes) Form1.Text1.Text = Form1.Text1.Text & "Start of element: " & _ strQName & vbCrLf End Sub
This method allows up to three names for each element:
Any or all of these name components may be specified, depending on the values of the "http://xml.org/sax/features/namespaces"
and the "http://xml.org/sax/features/namespace-prefixes"
features. The namespace URI and local name are required when the "http://xml.org/sax/features/namespaces"
feature is set to True (the default). These values are optional when this feature is set to False.
Note 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 "http://xml.org/sax/features/namespaces-prefixes feature"
is set to True and is optional when this feature is set to False (the default).
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 namespace declarations (xmlns* attributes) only if the "http://xml.org/sax/features/namespace-prefixes"
feature is set to True. This feature is set to False by default.
A corresponding endElement
method is called for every startElement
event, even when the element is empty.
The startElement
event allows up to three name components for each element:
Any or all of these name components may be specified, depending on the values of the "http://xml.org/sax/features/namespaces"
and the "http://xml.org/sax/features/namespace-prefixes"
features. The namespace URI and local name are required when the "http://xml.org/sax/features/namespaces"
feature is set to True (the default). These values are optional when this feature is set to False.
Note Neither the URI nor local name value can be specified alone. Both values are required if either is used.
The QName is required when the "http://xml.org/sax/features/namespaces-prefixes feature"
is set to True and is optional when this feature is set to False (the default).
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 namespace declarations (xmlns* attributes) only if the "http://xml.org/sax/features/namespace-prefixes"
feature is set to True. This feature is set to False by default.
HRESULT startElement( [in] const wchar_t * pwchNamespaceUri, [in] int cchNamespaceUri, [in] const wchar_t * pwchLocalName, [in] int cchLocalName [in] const wchar_t * pwchQName [in] int cchQName); [in] ISAXAttributes * pAttributes);
To view reference information for Visual Basic or C/C++ only, click the Language Filter button in the upper-left corner of the page.
Applies to: ISAXContentHandler/IVBSAXContentHandler Interface