Returns an ISchemaItem object. This object is the declaration of the DOM node that is sent to the function. The declaration specifies the schema information that is used to validate the document item in the DOM node. The ISchemaItem interface can be used to obtain further information about the schema declaration stored in the ISchemaItem object.
var oSchemaItem = oDom.namespaces.getDeclaration(oDOMNode);
node parameter.The following VBScript example shows the getDeclaration method in a schema.
' Load the doc.
Set oDoc = CreateObject("Msxml2.DOMDocument.5.0")
oDoc.async = false
oDoc.load "po2.xml"
If (xmlDoc.parseError.errorCode <> 0) Then
Dim myErr
Set myErr = xmlDoc.parseError
MsgBox("You have error " & myErr.reason)
Else
' Retrieve the namespace URI for schema used in
' purchase order document.
Set oDecl = oDoc.namespaces.getDeclaration(oDoc.documentElement)
WScript.Echo oDecl.namespaceURI
End If
Set oSchemaItem = oDom.namespaces.getDeclaration(oDOMNode)
node parameter.HRESULT getDeclaration(IXMLDOMNode* node, ISchemaItem** item);
To view reference information for Visual Basic or C/C++ only, click the Language Filter button
in the upper-left corner of the page.
Note The syntax oSchemaCollection.getDeclaration(oDOMNODE) is no longer supported and will return E_NOTIMPL.
Applies to: IXMLDOMSchemaCollection2