Indicates support for the specified feature.
boolVal = objXMLDOMImplementation.hasFeature(feature, version);
"XML", "DOM", and "MS-DOM" (case-insensitive)."1.0" is the valid version value.Boolean. Returns True if the specified feature is implemented; otherwise False.
var xmlDoc = new ActiveXObject("Msxml2.DOMDocument.5.0");
var bool = xmlDoc.implementation.hasFeature("DOM", "1.0");
alert(bool);
boolVal = objXMLDOMImplementation.hasFeature(feature, version)
"XML", "DOM", and "MS-DOM" (case-insensitive)."1.0" is the valid version value.Boolean. Returns True if the specified feature is implemented; otherwise False.
Dim xmlDoc As New Msxml2.DOMDocument50
Dim bool As Boolean
bool = xmlDoc.implementation.hasFeature("DOM", "1.0")
MsgBox bool
HRESULT hasFeature(
BSTR feature,
BSTR version,
VARIANT_BOOL *hasFeature);
"XML", "DOM", and "MS-DOM" (case-insensitive)."1.0" is the only valid version value.IXMLDOMImplementation *pIXMLDOMImplementation = NULL;
VARIANT_BOOL varbFlag ;
BSTR bstrOutput = NULL;
BSTR bstrFeature = ::SysAllocString(_T("MS-DOM"));
HRESULT hr;
IXMLDOMDocument *pIXMLDOMDocument = NULL;
try
{
// Create an instance of DOMDocument and initialize pIXMLDOMDocument.
// Load/create an XML fragment.
hr = pIXMLDOMDocument->get_implementation(&pIXMLDOMImplementation);
if(SUCCEEDED(hr) && pIXMLDOMImplementation)
{
hr = pIXMLDOMImplementation->hasFeature(bstrFeature, _T("1.0"), &varbFlag);
if(varbFlag == VARIANT_TRUE )
bstrOutput = ::SysAllocString(_T("Feature Supported"));
else
bstrOutput = ::SysAllocString(_T("Feature not Supported"));
::MessageBox(NULL, bstrOutput, bstrFeature, MB_OK);
::SysFreeString(bstrOutput);
bstrOutput = NULL;
::SysFreeString(bstrFeature);
bstrFeature = NULL;
pIXMLDOMImplementation->Release();
}
}
catch(...)
{
if(bstrOutput)
::SysFreeString(bstrOutput);
if(bstrFeature)
::SysFreeString(bstrFeature);
if(pIXMLDOMImplementation)
pIXMLDOMImplementation->Release();
DisplayErrorToUser();
}
// Release pIXMLDOMDocument when finished using it.
To view reference information for Visual Basic, C/C++, or Script only, click the Language Filter button
in the upper-left corner of the page.
Applies to: IXMLDOMImplementation