GV1 Posted June 4, 2009 Share Posted June 4, 2009 I'm developing an RSS feed reader that reads different feed types: RSS 1.0, RSS2.0, RSS 0.9 and Atom. To differentiate between the feed types, and chose how to parse the feed, I need to view the root node and it's attributes. I have searched high and low to figure out how to do this. Any advice? For example, RSS 0.9 feeds have <rdf:RDF ... as the root, 2.0 have <rss ... So far I can't figure out how to view the root node. I've even tried getElementsWithTagName() and it don't seem to pick up on the root node. Link to comment https://forums.phpfreaks.com/topic/160971-dom-object-how-do-i-get-the-nameattributes-of-the-root-element/ Share on other sites More sharing options...
GV1 Posted June 4, 2009 Author Share Posted June 4, 2009 Solved it. $xml->documentElement->tagName; Link to comment https://forums.phpfreaks.com/topic/160971-dom-object-how-do-i-get-the-nameattributes-of-the-root-element/#findComment-849521 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.