php man page for simplexml_import_dom

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.

SYNOPSIS
SimpleXMLElement simplexml_import_dom (DOMNode $node, [string $class_name = "SimpleXMLElement"])
DESCRIPTION
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.
PARAMETERS
o $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 VALUES
Returns 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.
EXAMPLES
Example #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: blah
SEE ALSO
dom_import_simplexml(3), "Basic SimpleXML usage". PHP Documentation Group SIMPLEXML_IMPORT_DOM(3)
Related Man Pages
xml::dom::text(3) - centos
template::plugin::xml::dom(3pm) - debian
xml::dom::text(3pm) - debian
xacobeo::utils(3pm) - debian
domdocument.createelement(3) - php
Similar Topics in the Unix Linux Community
Online/downloadable Shell Scripting book
An addition for UNIX books to read
Putting echoed text into a new file
Books for advanced C
How do you prefer to read books?