note 89824 deleted from intro.simplexml by salathe
| From: | salathe@php.net | Date: | Fri, 17 Aug 2012 15:31:41 +0000 |
| Subject: | note 89824 deleted from intro.simplexml by salathe | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-190119@lists.php.net to get a copy of this message | ||
Note Submitter: SL
----
SimpleXML has a beautiful simplicity. The following is one example of how it may be used with
namespaces.
Note, I use the XML that made Paul Reinheimer experience hair loss; for that XML see
http://blog.preinheimer.com/index.php?/archives/172-SimpleXML,-Namespaces-Hair-loss.html
<?php
$dom = new DOMDocument();
$dom->loadXML( $response );
$ns='urn:ebay:apis:eBLBaseComponents';
$domlist=$dom->getElementsByTagNameNS($ns,'*');
$sxe=simplexml_import_dom($domlist->item(0));
echo 'Ebay Timestamp ',$sxe->Timestamp;
?>
Running the above code left my own hair uneffected. :)