Simple way to get the URI of the default namespace:
<?php
$document = new DOMDocument();
$document->load($xml_file);
$uri = $document->documentElement->lookupnamespaceURI(NULL);
?>
(PHP 5, PHP 7, PHP 8)
DOMNode::lookupNamespaceURI — İsim alanı öneki belirtilen düğümün isim alanı betimleyicisini döndürür
$önek
): string
İsim alanı öneki önek
ile belirtilen düğümün isim
alanı betimleyicisini döndürür.
önek
İsim alanı öneki.
İsim alanını betimleyen adres.
Simple way to get the URI of the default namespace:
<?php
$document = new DOMDocument();
$document->load($xml_file);
$uri = $document->documentElement->lookupnamespaceURI(NULL);
?>