From ba69aedf2eece1496db74ef65eef82a89f8a45ac Mon Sep 17 00:00:00 2001 From: Mehdi Achour Date: Sat, 7 Feb 2004 13:19:59 +0000 Subject: [PATCH] this is the correct function (Davey too) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@150683 c90b9560-bf6c-de11-be94-00142212c4b1 --- .../functions/simplexml-import-dom.xml | 66 +++++++++++++++++++ 1 file changed, 66 insertions(+) create mode 100644 reference/simplexml/functions/simplexml-import-dom.xml diff --git a/reference/simplexml/functions/simplexml-import-dom.xml b/reference/simplexml/functions/simplexml-import-dom.xml new file mode 100644 index 0000000000..149fa58432 --- /dev/null +++ b/reference/simplexml/functions/simplexml-import-dom.xml @@ -0,0 +1,66 @@ + + + + + simplexml_import_dom + + Get a simplexml_element object from a + DOM node. + + + + Description + + object simplexml_elementsimplexml_load_dom + domNodenode + + + + This function takes a node of a DOM + document and makes it into a SimpleXML node. This new object can + then be used as a native SimpleXML element. If any errors occur, + it returns &false;. + + + + Import DOM + +loadXML('blah'); +if (!$dom) { + echo 'Error while parsing the document'; + exit; +} + +$s = simplexml_import_dom($dom); + +echo $s->book[0]->title; // blah +?> +]]> + + + + + +