Features are case-insensitive and are also defined for a specific set of versions. For example, this specification defines the features "Core" and "XML", for the version "3.0". Versions "1.0" and "2.0" can also be used for features defined in the corresponding DOM Levels. To avoid possible conflicts, as a convention, names referring to features defined outside the DOM specification should be made unique. Applications could then request for features to be supported by a DOM implementation using the methods DomImplementationSource::getDomImplementation(features) or DomImplementationSource::getDomImplementationList(features), check the features supported by a DOM implementation using the method DomImplementation::hasFeature(feature, version), or by a specific node using DomNode::isSupported(feature, version). Note that when using the methods that take a feature and a version as parameters, applications can use null or empty string for the version parameter if they dont wish to specify a particular version for the specified feature.
Up to the DOM Level 2 modules, all interfaces, that were an extension of existing ones, were accessible using binding-specific casting mechanisms if the feature associated to the extension was supported. For example, an instance of the DomEventTarget interface could be obtained from an instance of the DomNode interface if the feature "Events" was supported by the node.
As discussed [Mixed DOM Implementations], DOM Level 3 Core should be able to collaborate with subcomponents implementing specific DOMs. For that effect, the methods DomImplementation::getFeature(feature, version) and DomNode::getFeature(feature, version) were introduced. In the case of DomImplementation::hasFeature(feature, version) and DomNode::isSupported(feature, version), if a plus sign "+" is prepended to any feature name, implementations are considered in which the specified feature may not be directly castable but would require discovery through DomImplementation::getFeature(feature, version) and DomNode::getFeature(feature, version). Without a plus, only features whose interfaces are directly castable are considered.
// example 1, without prepending the "+" if( myNode.isSupported( "Events", "3.0" ) ) { EventTarget evt = static_cast<EventTarget>(myNode); // ... }
// example 2, with the "+" if( myNode.isSupported( "+Events", "3.0" ) ) { // (the plus sign "+" is irrelevant for the getFeature method itself // and is ignored by this method anyway) EventTarget evt = static_cast<EventTarget>( myNode.getFeature( "Events", "3.0" ) ); // ... }