for weeks and weeks...
etc.
>-----Original Message-----
>I've the following code, taken from
>
http://msdn.microsoft.com/library/default.asp? url=/library/en-us/dnexxml/html/xml02172003.asp
>to select a node from RSS file.
>However, I'm always getting a null returning for the
SelectSingleNode(),
>when trying to load a RSS 1.0 document, (which has a
default namespace)
>why?
>
>if(feed.DocumentElement.LocalName.Equals("RDF") &&
>feed.DocumentElement.NamespaceURI.Equals
("
http://www.w3.org/1999/02/22-rdf-s >yntax-ns#"))
>
>{
>
>NamespaceUri = "
http://purl.org/rss/1.0/";
>
>}
>
>else if(feed.DocumentElement.LocalName.Equals("rss"))
>
>{
>
>NamespaceUri = feed.DocumentElement.NamespaceURI;
>
>}
>
>else
>
>{
>
>throw new RssFeedException(ResourceFetcher.GetException
("Illegal feed"));
>
>}
>
>XmlNamespaceManager nsMgr = new XmlNamespaceManager
(feed.NameTable);
>
>nsMgr.AddNamespace("rss",NamespaceUri);
>
>node = feed.SelectSingleNode
("//rss:channel/title",nsMgr);//Select feed's
>title
>//node = feed.SelectSingleNode
("//rss:channel/rss:title",nsMgr);//Doesn't
>work as well!!!
>
>
>if(node!=null)//It's ALWAYS null if there is a default
namespace!
>
> title = node.InnerText;
>
>
>
>
>
>.