PHP
PHP / MySql

Recherche
 
ManuelPHP.com

SimpleXMLElement->xpath
<<<
simplexml_import_dom simplexml_load_file
>>>

8.119 Fonctions SimpleXML
8 Référence des fonctions
 Manuel PHP

Introduction
Pré-requis
Installation
Exemples
SimpleXMLElement->asXML
SimpleXMLElement->attributes
SimpleXMLElement->children
SimpleXMLElement->xpath
->simplexml_import_dom
simplexml_load_file
simplexml_load_string

8.119.9 simplexml_import_dom() Construit un objet SimpleXMLElement à partir d'une node DOM

[ Exemples avec simplexml_import_dom ]   PHP 5

SimpleXMLElement  simplexml_import_dom ( DOMNode   node , string   class_name )

simplexml_import_dom prend une node d'un document DOM et la transforme en node SimpleXML. Ce nouvel objet peut alors être utilisé comme un élément natif SimpleXML. Si une erreur survient, la fonction retourne FALSE .

Import DOM

<?php
$dom
= new domDocument;
$dom->loadXML('<books><book><title>blah</title></book></books>');
if (!
$dom) {
    echo
"Erreur durant l'analyse du document";
    exit;
}

$s = simplexml_import_dom($dom);

echo
$s->book[0]->title; // blah
?>

Voir aussi dom_import_simplexml .

<< simplexml_import_dom >>
SimpleXMLElement->xpath Fonctions SimpleXML simplexml_load_file





Google

Services webmasters

Les manuels
 

ManuelPHP.com © 2003-2012 Tigersun - Crédits
Webmaster Site Internet - Télécharger des Logiciels - Programme TV - Entraide Informatique - Agence de Communication
2012-05-25