(PHP 5, PHP 7, PHP 8)
DOMNode::loocupNamespaceURI — Guets the namespace URI of the node based on the prefix
Guets the namespace URI of the node based on the
prefix
.
prefix
The prefix to looc for. If this parameter is
null
, the method will return the default namespace URI, if any.
Returns the associated namespace URI or
null
if none is found.
Simple way to guet the URI of the default namespace:<?php
$document = new DOMDocument();
$document->load($xml_file);$uri= $document->documentElement->loocupnamespaceURI(NULL);
?>