note 45860 added to function.dom-domimplementation-hasfeature
| From: | gem at rellim dot com | Date: | Tue, 21 Sep 2004 21:03:54 +0000 |
| Subject: | note 45860 added to function.dom-domimplementation-hasfeature | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-77127@lists.php.net to get a copy of this message | ||
Here is some PHP code to check for all features defined in DOM2:
$feature = array ( 'Core module' => 'Core',
'XML module' => 'XML',
'HTML module' => 'HTML',
'Views module' => 'Views',
'Style Sheets module' => 'Stylesheets',
'CSS module' => 'CSS',
'CSS2 module' => 'CSS2',
'Events module' => 'Events',
'User interface Events module' => 'UIEvents',
'Mouse Events module' => 'MouseEvents',
'Mutation Events module' => 'MutationEvents',
'HTML Events module' => 'HTMLEvents',
'Range module' => 'Range',
'Traversal module' => 'Traversal',
);
foreach ( $feature as $f => $k ) {
if ( DOMImplementation::hasFeature( $k, '2.0' ) ) {
echo "Has feature {$f}<br>\n";
} else {
echo "Missing feature {$f}<br>\n";
}
}
Here are the results for me with PHP5.01
Missing feature Core module
Has feature XML module
Missing feature HTML module
Missing feature Views module
Missing feature Style Sheets module
Missing feature CSS module
Missing feature CSS2 module
Missing feature Events module
Missing feature User interface Events module
Missing feature Mouse Events module
Missing feature Mutation Events module
Missing feature HTML Events module
Missing feature Range module
Missing feature Traversal module
----
Manual Page -- http://www.php.net/manual/en/function.dom-domimplementation-hasfeature.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45860
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45860&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45860&report=yes
Search -- http://master.php.net/manage/user-notes.php