PHP: Function parseFeed(feed_href) Dim xmlhttp Set xmlhttp = Server.CreateObject("Microsoft.XMLHTTP") xmlhttp.open "GET", feed_href, False xmlhttp.send() Dim xmldom, root, root_nodename, root_version Set xmldom = Server.CreateObject("Microsoft.XMLDOM") xmldom.async = False xmldom.ValidateOnParse = False xmldom.load(xmlhttp.responseXML) If xmldom.parseError.errorCode <> 0 Then Dim myErr : Set myErr = xmldom.parseError parseFeed = "错误:" & myErr.reason Else Set root = xmldom.documentElement parseFeed = root.nodeName End IfEnd Function PHP: Response.Write(parseFeed("http://www.theme8.com/index.php/feed/atom/")) ATOM 文件的代码大致如下: HTML: <?xml version="1.0" encoding="UTF-8"?><feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en" > <title>主题吧</title> <link rel="alternate" type="text/html" href="http://www.theme8.com" /> <tagline>各种主流 Web 程序主题制作与发布</tagline> <modified>2006-10-31T10:21:56Z</modified> <copyright>Copyright 2006</copyright> <generator url="http://wordpress.org/" version="2.0.5">WordPress</generator> <entry> <author> <name>Ulysses</name> </author> <title type="text/html" mode="escaped"><![CDATA[Adventure for WordPress]]></title> <link rel="alternate" type="text/html" href="http://www.theme8.com/index.php/2006/10/31/adventure-for-wordpress/" /> <id>http://www.theme8.com/index.php/2006/10/31/adventure-for-wordpress/</id> <modified>2006-10-31T10:01:07Z</modified> <issued>2006-10-31T10:01:07Z</issued> <dc:subject>WebLog</dc:subject> <dc:subject>WordPress</dc:subject><dc:subject>Fixed width</dc:subject><dc:subject>Gray</dc:subject><dc:subject>Right sidebar</dc:subject><dc:subject>WebLog</dc:subject><dc:subject>WordPress</dc:subject> <summary type="text/plain" mode="escaped"><![CDATA[名称:Adventure 版本:v0.1 更新:2006-10-11 语言:英文 作者:PHPZen 预览:查看预览图片 适用:WordPress 2.0.x 下载:PHPZen | 本地下载 说明 After months of traveling and getting use from my theme from Calin (I ho... ]]></summary> </entry> </feed>
<feed version="0.3" xmlns="http://purl.org/atom/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/" xml:lang="en" > ... </feed> 这已经是顶层元素了啊。