OBJECT:  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.

Code (JavaScript):
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

METHODS

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

Syntax: DOMImplementation.hasFeature(feature, version)


Copyright 1999-2001 by Infinite Software Solutions, Inc. All rights reserved.
Trademark Information