dom_import_simplexml SimpleXMLElement オブジェクトから DOMElement オブジェクトを取得する &reftitle.description; DOMAttrDOMElementdom_import_simplexml objectnode この関数は、指定された node (SimpleXMLElement のインスタンス) を受けとり、 DOMAttr または DOMElement をそれぞれ作成します。 新しい DOMNode は、 既にある同じXMLノードを SimpleXMLElement として参照しています。 &reftitle.parameters; node インポートする属性または要素 (SimpleXMLElement のインスタンス) &reftitle.returnvalues; DOMAttr または DOMElement を返します。 &reftitle.changelog; &Version; &Description; 8.0.0 この関数は、失敗時に &null; を返さなくなりました。 &reftitle.examples; <function>dom_import_simplexml</function> を用いて SimpleXML を DOM にインポートする blah'); if ($sxe === false) { echo 'ドキュメントのパース中にエラー'; exit; } $dom_sxe = dom_import_simplexml($sxe); if (!$dom_sxe) { echo 'XML の変換中にエラー'; exit; } $dom = new DOMDocument('1.0'); $dom_sxe = $dom->importNode($dom_sxe, true); $dom_sxe = $dom->appendChild($dom_sxe); 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 ]]> &reftitle.seealso; simplexml_import_dom