DomDocument->document_element

(no version information, might be only in CVS)

DomDocument->document_element --  Restituisce il nodo radice

Descrizione

object DomDocument->document_element ( void )

Questa funzione restituisce il nodo radice di un documento.

Nell'esempio seguente la funzione restituisce l'elemento con nome CHAPTER. L'altro nodo -- the comment -- non viene restituito.

Esempio 1. Recupero dell'elemento radice

<?php
include("example.inc");

if (!
$dom = domxml_open_mem($xmlstr)) {
  echo
"Errore nel parsing del documento\n";
  exit;
}

$root = $dom->document_element();
print_r($root);
?>