Home > PHP > Function > SimpleXML > simplexml_import_dom()

simplexml_import_dom()

simplexml_import_dom - Get a
SimpleXMLElementobject from a DOM node.

Syntax

SimpleXMLElement simplexml_import_dom (DOMNode $node, string $class_name)

Arguments

  • node - A DOMElement node
  • class_name - You may use this optional parameter so that simplexml_import_dom() will return an object of the specified class. That class should extend the SimpleXMLElement class.

Description

This function takes a node of a DOMdocument and makes it into a SimpleXML node. This new object can then be used as a native SimpleXML element.

Version

PHP 5

Return value

Returns a SimpleXMLElement or FALSE on failure.