SimpleXMLElement::getNamespaces
ドキュメントで使用している名前空間を返す
&reftitle.description;
public arraySimpleXMLElement::getNamespaces
boolrecursive&false;
ドキュメントで使用している名前空間を返します。
&reftitle.parameters;
recursive
指定されている場合は、親ノードおよび子ノードで使用している全ての名前空間を返します。
されていない場合は、ルートノードで使用している名前空間のみを返します。
&reftitle.returnvalues;
getNamespaces メソッドは、
名前空間名および関連付けられた URI を配列で返します。
&reftitle.examples;
ドキュメントで使用している名前空間の取得
John Doe
Susie Q. Public
XML;
$sxe = new SimpleXMLElement($xml);
$namespaces = $sxe->getNamespaces(true);
var_dump($namespaces);
?>
]]>
&example.outputs;
string(21) "http://example.org/ns"
}
]]>
&reftitle.seealso;
SimpleXMLElement::getDocNamespaces
SimpleXMLElement::registerXPathNamespace