XML DOM » Objects » DOMImplementation

The DOMImplementation object provides methods that are independent of any particular instance of the Document Object Model. In Level 1 valid features are (case insensitive) 'XML', 'HTML', 'DOM' and 'MS-DOM'. In Level 1 the valid version value is '1.0'. The following example uses the hasFeature method to determine whether this implementation of the 'states.xml' file supports HTML and XML.

Examples

Code:
xml_doc = new ActiveXObject("Microsoft.XMLDOM");
xml_doc.async = false;
xml_doc.load("states.xml");

implementation = xml_doc.implementation
has_feature = implementation.hasFeature("html", "1.0");
document.write("HTML: " + has_feature);
has_feature = implementation.hasFeature("xml", "1.0");
document.write("<br>XML: " + has_feature);
Output:
HTML: false
XML: true
Language(s): JavaScript

Methods

hasFeature

Syntax: object.hasFeature(feature, version)

This method returns a value of true if the specified version supports the specified feature.