PHP 5.6.0beta1 released

La classe DOMImplementation

(PHP 5)


L'interface DOMImplementation fournit des méthodes pour effectuer des opérations qui sont indépendantes d'une instance particulière du modèle objet d'un document.

Synopsis de la classe

DOMImplementation {
/* Propriétés */
/* Méthodes */
__construct ( void )
public DOMDocument createDocument ([ string $namespaceURI = NULL [, string $qualifiedName = NULL [, DOMDocumentType $doctype = NULL ]]] )
public DOMDocumentType createDocumentType ([ string $qualifiedName = NULL [, string $publicId = NULL [, string $systemId = NULL ]]] )
public bool hasFeature ( string $feature , string $version )


add a note add a note

User Contributed Notes 1 note

giorgio dot liscio at email dot it
3 years ago
officially, the w3 specifies that the way to access dom interfaces is through this class

so if you use

$doc = new DOMDocument("1.0", "UTF-8");

use instead:

$x = new DOMImplementation();
$doc = $x->createDocument(NULL,"rootElementName");

it is not required by php's implementation, but, probably, it is a good practice

To Top