Mathias Brodala: Namensraum ermitteln

Beitrag lesen

Hallo Thomas.

nein, funktioniert nicht ;-(((

Hm, sicher? Mein Versuch:

$str_doc = '<?xml version="1.0" encoding="utf-8"?>  
<title type="xhtml" xmlns:xhtml="http://www.w3.org/1999/xhtml">  
  <xhtml:div>  
    Less: <xhtml:em> &lt; </xhtml:em>  
  </xhtml:div>  
</title>';  
  
$obj_doc = new DOMDocument();  
$obj_doc->loadXML($str_doc);  
  
echo $obj_doc->getElementsByTagName('div')->item(0)->lookupPrefix('http://www.w3.org/1999/xhtml'); # → xhtml

Einen schönen Montag noch.

Gruß, Mathias

--
sh:( fo:} ch:? rl:( br: n4:~ ie:{ mo:| va:) de:> zu:} fl:( ss:) ls:[ js:|
„It is required that HTML be a common language between all platforms. This implies no device-specific markup, or anything which requires control over fonts or colors, for example. This is in keeping with the SGML ideal.“
[HTML Design Constraints: Logical Markup]