嘿,我正在阅读我的 XML RSS 提要,如下所示:
Dim rssSubNode As XmlNode = rssNode.SelectSingleNode("title")
Dim title As String = If(rssSubNode IsNot Nothing, rssSubNode.InnerText, "")
rssSubNode = rssNode.SelectSingleNode("itunes:author")
Dim author As String = If(rssSubNode IsNot Nothing, rssSubNode.InnerText, "")
标题检索得很好。但是,当它尝试获取作者时,会出现以下错误:
Value of type 'System.Xml.XmlNodeList' cannot be converted to 'System.Xml.XmlNode'.
我的 XML 文件如下所示:
<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd" version="2.0">
<channel>
<item>
<title>First Chaper</title>
<itunes:author>My Name Here</itunes:author>
<itunes:subtitle>First Chapter: The blah blah.</itunes:subtitle>
etc etc....
为了获得该价值,我需要添加什么?