Simple way to get the URI of the default namespace:
<?php
$document = new DOMDocument();
$document->load($xml_file);
$uri = $document->documentElement->lookupnamespaceURI(NULL);
?>
DOMNode::lookupNamespaceURI
(PHP 5)
DOMNode::lookupNamespaceURI — Gets the namespace URI of the node based on the prefix
Beschreibung
string DOMNode::lookupNamespaceURI
( string $prefix
)
Gets the namespace URI of the node based on the prefix .
Parameter-Liste
- prefix
-
The prefix of the namespace.
Rückgabewerte
The namespace URI of the node.
DOMNode::lookupNamespaceURI
lewar
05-Jun-2007 02:20
05-Jun-2007 02:20
