Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/12.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/flutter/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# c读取带有名称空间问题的xml_C#_Xml_Namespaces - Fatal编程技术网

C# c读取带有名称空间问题的xml

C# c读取带有名称空间问题的xml,c#,xml,namespaces,C#,Xml,Namespaces,我想阅读rss/channel/itunes:subtitle中的值 xml:参见 我试过: System.Xml.XmlDocument pd = new System.Xml.XmlDocument(); pd.Load(podcasterUrl); XmlElement resultt = pd.DocumentElement; XmlNamespaceManager mgr = new XmlNamespaceManager(pd.NameTable); mgr.AddNamespace

我想阅读rss/channel/itunes:subtitle中的值

xml:参见

我试过:

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.com/dtds/podcast-1.0.dtd");
XmlNode nodeS = resultt.SelectSingleNode("/rss/channel/itunes:subtitle", mgr);
string subtitle = nodeS.InnerText.ToString();
副标题为:

This is the official ...
但在XML中是这样的

Representing the ...

有人能帮我吗?

使用你的代码,我收到了副标题,作为舞蹈音乐中较难的风格的代表。我检查了你的代码,我得到了较难的风格的代表。。。也可能因为摘要和副标题而有点混乱?好的,问题是我使用了另一个xml文件,而不是数据库中的。它起作用了!使用你的代码,我收到了副标题,作为舞蹈音乐中较难的风格的代表。我检查了你的代码,我得到了较难的风格的代表。。。也可能因为摘要和副标题而有点混乱?好的,问题是我使用了另一个xml文件,而不是数据库中的。它起作用了!