开发者

c# Reading xml with namespace problem [closed]

开发者 https://www.devze.com 2023-03-15 04:39 出处:网络
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time,or an extraordinarily narrow situation that is not generally applic
This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center. Closed 11 years ago.

I want to read the value in rss/channel/itunes:subtitle

xml: see http://podcast.q-dance.nl/audio/qdance/q-dancepodcast.xml

I tried:

System.Xml.XmlDocument pd = new System.Xml.XmlDocument();
pd.Load(podcasterUrl);
XmlElement resultt = pd.DocumentElement;
XmlNamespaceManager mgr = new XmlNamespaceManager(pd.NameTable);
mgr.AddNamespace("itunes", "http://www.itunes开发者_StackOverflow.com/dtds/podcast-1.0.dtd");
XmlNode nodeS = resultt.SelectSingleNode("/rss/channel/itunes:subtitle", mgr);
string subtitle = nodeS.InnerText.ToString();

subtitle is now:

This is the official ...

but in XML it is

Representing the ...

Can someone help me?

0

精彩评论

暂无评论...
验证码 换一张
取 消