downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

DOMNode::lookupPrefix> <DOMNode::isSupported
[edit] Last updated: Fri, 17 May 2013

view this page in

DOMNode::lookupNamespaceURI

(PHP 5)

DOMNode::lookupNamespaceURI Obtiene la URI del espacio de nombres del nodo basado en el prefijo

Descripción

public string DOMNode::lookupNamespaceURI ( string $prefix )

Obtiene la URI del espacio de nombres del nodo basado en prefix.

Parámetros

prefix

El prefijo del espacio de nombres.

Valores devueltos

La URI del espacio de nombres del nodo.

Ver también

  • DOMNode::lookupPrefix() - Obtiene el prefijo del espacio de nombres del nodo basándoes en la URI del espacio de nombres



add a note add a note User Contributed Notes DOMNode::lookupNamespaceURI - [2 notes]
up
0
_ michael
3 years ago
You have to pass *null* to lookupNamespaceURI if you want to read the default namespace. Passing an empty string doesn't work - even though the documentation says that lookupNamespaceURI takes a string as argument (and null would just be converted to an empty string).
up
-1
lewar
5 years ago
Simple way to get the URI of the default namespace:

<?php
    $document
= new DOMDocument();
   
$document->load($xml_file);
   
$uri = $document->documentElement->lookupnamespaceURI(NULL);
?>

 
show source | credits | stats | sitemap | contact | advertising | mirror sites