Query: simplexml_import_dom
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
SIMPLEXML_IMPORT_DOM(3) 1 SIMPLEXML_IMPORT_DOM(3) simplexml_import_dom - Get a SimpleXMLElementobject from a DOM node.SYNOPSISSimpleXMLElement simplexml_import_dom (DOMNode $node, [string $class_name = "SimpleXMLElement"])DESCRIPTIONThis 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.PARAMETERSo $node - A DOM Element node o $class_name - You may use this optional parameter so that simplexml_import_dom(3) will return an object of the specified class. That class should extend the SimpleXMLElement class.RETURN VALUESReturns a SimpleXMLElement or FALSE on failure. Warning This function may return Boolean FALSE, but may also return a non-Boolean value which evaluates to FALSE. Please read the section on Booleans for more information. Use the === operator for testing the return value of this function.EXAMPLESExample #1 Importing DOM <?php $dom = new DOMDocument; $dom->loadXML('<books><book><title>blah</title></book></books>'); if (!$dom) { echo 'Error while parsing the document'; exit; } $s = simplexml_import_dom($dom); echo $s->book[0]->title; ?> The above example will output: blahSEE ALSOdom_import_simplexml(3), "Basic SimpleXML usage". PHP Documentation Group SIMPLEXML_IMPORT_DOM(3)
Related Man Pages |
---|
domdocument.getelementbyid(3) - php |
simplexml_load_file(3) - php |
simplexmliterator(3) - php |
xml::dom::text(3) - suse |
xml::dom::text(3) - centos |
Similar Topics in the Unix Linux Community |
---|
Books needed. |
Online/downloadable Shell Scripting book |
An addition for UNIX books to read |
Putting echoed text into a new file |
What is meant by subprocesses? |