Main Page

XML DOM Level 1

The
implementation
object is a property of a DOM Document, and is, therefore, part of the browser
document
object. The sole method of
implementation
is
hasFeature()
, which accepts two parame-
ters: the feature to check and the version of that feature. For instance, if you want to check for support
of XML DOM Level 1, the call would be:
var bXmlLevel1 = document.implementation.hasFeature(“XML”, “1.0”);
The following table lists all the DOM features and the corresponding versions to check for:
Feature
Supported Description
Versions
Core
1.0, 2.0, 3.0 Basic DOM spelling out the use of a hierarchical tree to repre-
sent documents
XML
1.0, 2.0, 3.0 XML extension of the Core that adds support for CDATA sec-
tions, processing instructions, and entities
HTML
1.0, 2.0
HTML extension of XML that adds support for HTML-
specific elements and entities
Views
2.0
Accomplishes formatting of a document based on certain
styles
StyleSheets
2.0
Relating style sheets to documents
CSS
2.0
Support for Cascading Style Sheets Level 1
CSS2
2.0
Support for Cascading Style Sheets Level 2
Events
2.0
Generic DOM events
UIEvents
2.0
User interface events
MouseEvents 2.0
Events caused by the mouse (click, mouseover, and so on)
MutationEvents 2.0
Events fired when the DOM tree is changed
HTMLEvents 2.0
HTML 4.01 events
Range
2.0
Objects and methods for manipulating a range in a DOM tree
Traversal
2.0
Methods for traversing a DOM tree
LS
3.0
Loading and saving between files and DOM trees
synchronously
LS-Async
3.0
Loading and saving between files and DOM trees
asynchronously
Validation
3.0
Methods to modify a DOM tree and still make it valid
Although it is a nice convenience, the drawback of using
implementation.hasFeature()
is that the
implementor
gets to decide if the implementation is indeed conformant with the various parts of the
DOM specification. It’s very easy to make this method return
true
for any and all values, but that doesn’t
190
Chapter 6
09_579088 ch06.qxd 3/28/05 11:37 AM Page 190


JavaScript EditorFree JavaScript Editor     Ajax Editor


©