Thomas Mell: Namensraum ermitteln

Beitrag lesen

Hallo,
ich möchte nicht den Prefix (z. B. "xhtml") bekommen, sondern den Namensraum "http://www.w3.org/1999/xhtml".
Der Prefix könnte auch fehlen:
<summary type="xhtml">
   <div xmlns="http://www.w3.org/1999/xhtml">
      This is <b>XHTML</b> content.
   </div>
</summary>

ich habe da was mit XPath gefunden (namespace-uri), allerdings bekomme ich das nicht in PHP zum laufen:
$XML = '
<root xmlns:xh="http://www.w3.org/1999/xhtml" xmlns="http://abc.de">
<summary type="xhtml">
   xh:div
      This is xh:bXHTML</xh:b> content.
   </xh:div>
</summary>
</root>';

$dom = domxml_open_mem($XML);
$xpath = $dom->xpath_new_context();

$node = xpath_eval_expression($xpath, "namespace-uri(//root/summary/div)");

Ich bekomme zwar ein Objekt geliefert, weiß aber nicht wie ich nun an den Namensraum kommen soll...

Grüße
Thomas