note 89824 modified in intro.simplexml by danbrown
| From: | danbrown@php.net | Date: | Tue, 24 Mar 2009 23:11:22 +0000 |
| Subject: | note 89824 modified in intro.simplexml by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-152407@lists.php.net to get a copy of this message | ||
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. :)
--was--
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
$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. :)
http://php.net/manual/en/intro.simplexml.php