diff --git a/reference/dom/functions/dom-import-simplexml.xml b/reference/dom/functions/dom-import-simplexml.xml index 7e3cffdfc13f..0ad2db69f7b9 100644 --- a/reference/dom/functions/dom-import-simplexml.xml +++ b/reference/dom/functions/dom-import-simplexml.xml @@ -11,14 +11,15 @@ &reftitle.description; - DOMElementdom_import_simplexml + DOMAttrDOMElementdom_import_simplexml objectnode - This function takes the node node of class - SimpleXML and makes it into a - DOMElement node. This new object can then be used - as a native DOMElement node. + This function takes the given attribute or element node (a + SimpleXMLElement instance) and creates a + DOMAttr or DOMElement node, repectively. + The new DOMNode refers to the same underlying XML node + as the SimpleXMLElement. @@ -29,7 +30,7 @@ node - The SimpleXMLElement node. + The attribute or element node to import (a SimpleXMLElement instance). @@ -39,7 +40,7 @@ &reftitle.returnvalues; - The DOMElement node added. + The DOMAttr or DOMElement. @@ -95,6 +96,38 @@ echo $dom->saveXML(); ?> ]]> + &example.outputs; + + +blah +]]> + + + + Import SimpleXML into DOM and modify SimpleXML through DOM + + Error handling omitted for brevity. + + +blah'); +$elt = dom_import_simplexml($sxe); +$elt->setAttribute("foo", "bar"); +echo $sxe->asXML(); + +?> +]]> + + &example.outputs; + + +blah +]]> +