note 47614 added to function.dom-domnode-issupported

From: Date: Mon, 22 Nov 2004 22:17:26 +0000
Subject: note 47614 added to function.dom-domnode-issupported
Groups: php.notes 
Request: Send a blank email to php-notes+get-80894@lists.php.net to get a copy of this message
DOMNode->isSupported() seems to return the same values as DOMImplementation->hasFeature(). The only difference I see is that there is NO static DOMNode::isSupported(). Here is an example trying all the features defined in DOM2: <?php $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', ); $doc = new DOMDocument(); $node = $doc->createElement("mynode"); echo " 1.0 2.0 3.0 Feature\n"; foreach ( $feature as $f => $k ) { foreach ( array( '1.0', '2.0', '3.0' ) as $v ) { if ( $node->isSupported( $k, $v ) ) { echo " Yes"; } else { echo " No "; } } echo " {$f}\n"; } ?> Run it and you get: 1.0 2.0 3.0 Feature Yes No No Core module Yes Yes No XML module No No No HTML module No No No Views module No No No Style Sheets module No No No CSS module No No No CSS2 module No No No Events module No No No User interface Events module No No No Mouse Events module No No No Mutation Events module No No No HTML Events module No No No Range module No No No Traversal module Here is a link to all the DOM3 features (URL wrapped): http://www.w3.org/TR/2004/REC-DOM-Level-3-Core-20040407/ introduction.html ---- Manual Page -- http://www.php.net/manual/en/function.dom-domnode-issupported.php Edit -- http://master.php.net/manage/user-notes.php?action=edit+47614 Delete -- http://master.php.net/manage/user-notes.php?action=delete+47614&report=yes Reason: bad code -- http://master.php.net/manage/user-notes.php?action=delete+47614&report=yes&reason=bad+code Reason: spam -- http://master.php.net/manage/user-notes.php?action=delete+47614&report=yes&reason=spam Reason: useless example -- http://master.php.net/manage/user-notes.php?action=delete+47614&report=yes&reason=useless+example Reason: contains commercial links -- http://master.php.net/manage/user-notes.php?action=delete+47614&report=yes&reason=contains+commercial+links Reason: useless note -- http://master.php.net/manage/user-notes.php?action=delete+47614&report=yes&reason=useless+note Reject -- http://master.php.net/manage/user-notes.php?action=reject+47614&report=yes Search -- http://master.php.net/manage/user-notes.php

« previous php.notes (#80894) next »