Not getting xml node because of colon

AttalryStairl

New Member
I have an XML document, and it uses slash:comments. When I use php to try and retrieve things within these nodes, it just doesn't work.Here's my code:\[code\] <?php$rss = new DOMDocument();$rss->load('http://terrodactyl.netau.net/wordpress/?feed=rss2');$feed = array();foreach ($rss->getElementsByTagName('item') as $node) { $item = array ( 'title' => $node->getElementsByTagName('title')->item(0)->nodeValue, 'desc' => $node->getElementsByTagName('description')->item(0)->nodeValue, 'link' => $node->getElementsByTagName('link')->item(0)->nodeValue, 'date' => $node->getElementsByTagName('pubDate')->item(0)->nodeValue, 'commentcount' => $node->getElementsByTagName('slash:comments')->item(0)->nodeValue, 'creator' => $node->getElementsByTagName('dc:creator')->item(0)->nodeValue, ); array_push($feed, $item);}$limit = 5;for($x=0;$x<$limit;$x++) { $title = str_replace(' & ', ' & ', $feed[$x]['title']); $link = $feed[$x]['link']; $description = $feed[$x]['desc']; $date = date('l F d, Y', strtotime($feed[$x]['date'])); $creator = $feed[$x]['creator']; $comments = $feed[$x]['commentcount']; echo "<div class=
 
Back
Top