SimpleXML - parsing attributes with a namespace

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

Using following code does not parse the "xml:id" attribute. If I change the attribute's namespace to anything other than "xml" ( e.g. "new:id" ) then it works.

$string = <<<XML
<TEI xml:id="decten1tlsg01">
<teiHeader> 
<profileDesc> 
<particDesc>
 <person xml:id="interviewerTlsg01"> </person>
 </particDesc>
 </profileDesc> 
 </teiHeader> 
</TEI>
XML;
$xml = simplexml_load_string($string);
foreach($xml->teiHeader->profileDesc->particDesc->person[0]->attributes() as $a => $b) {
    echo "<p>$a = $b \n</p>";
}

Is this a bug? And how do I get this to work?

Many thanks,
Anthony

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux