BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
PHP XML
PHP DOMNode Function isSameNode
PHP DOMNode Function insertBefore
PHP DOMNode Function hasChildNodes
PHP DOMNode Function hasAttributes
PHP DOMNode Function cloneNode
PHP DOMNodelist Function item
PHP DOMNamedNodeMap Function item
PHP DOMNamedNodeMap Function getNamedItemNS
PHP DOMNamedNodeMap Function getNamedItem
PHP DOMImplementation Function hasFeature
PHP DOMImplementation Function createDocumentType
PHP DOMImplementation Function createDocument
PHP DOMElement Function removeAttributeNS
PHP DOMElement Function removeAttributeNode
PHP DOMElement Function removeAttribute
PHP DOMElement Function hasAttributeNS
PHP DOMElement Function getAttribute
PHP DOMDocument Function getElementsByTagNameNS
PHP DOMDocument Function xinclude
PHP DOMDocument Function validate
 
 

By :Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :03/24/2008
Times viewed :206

 

DOMNode Function isSupported

PHP Version: (No version information might be only in CVS. I have used this function in PHP5)

Description

This function checks if a feature supported by a version or not.

Usage:

boolDOMNode->isSupported ( string feature, string version)

Checks if feature is supported for specified version.

PHP Code:

<?php

//put all features in the array so that we can test whether DOMNode implements a

//particular feature or not

$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',

               );

//create a dom node.

$node = new DOMNode;

echo "<HTML>";

echo "<Head>";

echo "<title>Example of DOMNode->isSupported</title>";

echo "<Head>";

echo "<body>";

echo "<PRE>";

foreach ( $feature as $f => $k ) {

      if ( $node->isSupported( $k, '2.0' ) ) {

           echo "DOMNode supports feature {$f}<br>\n";

      } else {

           echo "DOMNode does not support feature {$f}<br>\n";

      }

echo "</PRE>";

echo "</body>";

echo "</HTML>";

?>

Output:

The expected output would be:

DOMNode does not support feature Core module

DOMNode supports feature XML module

DOMNode does not support feature HTML module

DOMNode does not support feature Views module

DOMNode does not support feature Style Sheets module

DOMNode does not support feature CSS module

DOMNode does not support feature CSS2 module

DOMNode does not support feature Events module

DOMNode does not support feature User interface Events module

DOMNode does not support feature Mouse Events module

DOMNode does not support feature Mutation Events module

DOMNode does not support feature HTML Events module

DOMNode does not support feature Range module

DOMNode does not support feature Traversal module
 
If you change the version to 1.0m the output would be:
 
DOMNode supports feature Core module //this is not supported in version 2.0

DOMNode supports feature XML module

DOMNode does not support feature HTML module

DOMNode does not support feature Views module

DOMNode does not support feature Style Sheets module

DOMNode does not support feature CSS module

DOMNode does not support feature CSS2 module

DOMNode does not support feature Events module

DOMNode does not support feature User interface Events module

DOMNode does not support feature Mouse Events module

DOMNode does not support feature Mutation Events module

DOMNode does not support feature HTML Events module

DOMNode does not support feature Range module

DOMNode does not support feature Traversal module




Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

An immediate job opportunity as a B
Software Developers Needed in Charl
Sr. Software Engineer - Analytics
Immediate Mainframe openings for Ch
Immediate TANDEM-TAL openings for C

View all Jobs (Add yours)
View all CV (Add yours)



answering service
help desk support
swimming pool contractor
halloween masks
water softener
Teleconference
Host Department NOLIMIT Web Hosting
MSN
sunglasses


    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP