I am trying to parse a XML document but can not seem to parse both Childnodes and Attributes in the same Foreach statement.
=====================
PHP CODE
=====================
<?PHP
$webResults = $response->getElementsByTagName($prnt0);
if ($webResults->length<>0) {
foreach($webResults as $value){
$title = $value->childNodes->item($child1)->nodeValue;
}
}
?>
Need the title childnode and all links from tag name "links" attribute "href" Thanks in Advance!
=====================
XML is from twitter
=====================
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns:google="base.google.com/ns/1.0" xml:lang="en-US" xmlns:openSearch="a9.com/-/spec/opensearch/1.1/" xmlns="www.w3.org/2005/Atom" xmlns:twitter="api.twitter.com/">
<entry>
<id>tag:search.twitter.com,2005:1982519510</id>
<published>2009-05-31T18:22:20Z</published>
<link type="text/html" rel="alternate" href="twitter.com/buildasearch/statuses/1982519510"/>
<title>New Search Background Uploader ! Upload your favorite background image to BuildaSearch. GIF - JPEG - PNG. Just do it!</title>
<content type="html">New Search Background Uploader ! Upload your favorite background image to <b>BuildaSearch</b>. GIF - JPEG - PNG. Just do it!</content>
<updated>2009-05-31T18:22:20Z</updated>
<link type="image/png" rel="image" href="amazonaws.com/twitter_production/profile_images/66983558/build_normal.png"/>
<twitter:source><a href="twitter.com/">web</a></twitter:source>
<twitter:lang>en</twitter:lang>
<author>
<name>buildasearch (buildasearch)</name>
<uri>twitter.com/buildasearch</uri>
</author>
</entry>
</feed>