PHP Doku:: Gets the namespace URI of the node based on the prefix - domnode.lookupnamespaceuri.html

Verlauf / Chronik / History: (1) anzeigen

Sie sind hier:
Doku-StartseitePHP-HandbuchFunktionsreferenzXML-ManipulationDocument Object ModelThe DOMNode classDOMNode::lookupNamespaceURI

Ein Service von Reinhard Neidl - Webprogrammierung.

The DOMNode class

<<DOMNode::isSupported

DOMNode::lookupPrefix>>

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.

Siehe auch


2 BenutzerBeiträge:
- Beiträge aktualisieren...
_ michael
30.04.2010 23:22
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).
lewar
5.06.2007 14:20
Simple way to get the URI of the default namespace:

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



PHP Powered Diese Seite bei php.net
The PHP manual text and comments are covered by the Creative Commons Attribution 3.0 License © the PHP Documentation Group - Impressum - mail("TO:Reinhard Neidl",...)