Reference Article : Http://chs.gotdotnet.com/quickstart/howto/doc/Xml/XmlNameSpace.aspx
Even source code:
Public void bindxml (string xmlurl)
{
System. xml. xmldocument Doc = new system. xml. xmldocument ();
Doc. Load (system. appdomain. currentdomain. basedirectory + "kkjj. xml ");
// Doc. Load (xmlurl );
Doc. selectnodes ("/RSS/channel ");
System. xml. xmlnode root = Doc. documentelement;
System. xml. xmlnode xn = root. selectsinglenode ("/RSS/channel ");
Outstr + = "album name:" + Xn. selectsinglenode ("title"). innertext; // album name
Outstr + = "<br> album URL:" + Xn. selectsinglenode ("Link"). innertext; // album URL
Outstr + = "<br> album image:
// Outstr + = "<br> ";
System. xml. xmlnodelist xnl = xn. selectnodes ("item ");
Outstr + = "<br> Number of album images:" + xnl. Count. tostring () + "Zhang ";
System. xml. xmlnamespacemanager nsmanager = new system. xml. xmlnamespacemanager (Doc. nametable );
Nsmanager. addnamespace ("Media", "http://search.yahoo.com/mrss ");
// Create a string containing the XPath expression for calculation.
String exprstring = string. Format ("// {0}: Group", "Media ");
System. xml. xmlnodelist nodelist = Doc. selectnodes (exprstring, nsmanager );
Outstr + = "<br> media: title:" + nodelist [0]. selectsinglenode ("Media: Title", nsmanager). attributes ["type"]. innertext;
// For (INT I = 0; I <xnl. Count; I ++)
//{
// Outstr + = "<br> ";
//}
}
At that time, I saw it .. Gg's XML contains a colon, and Kaka solves the problem ..
Add XML snippets
-<Media: group>
<Media: Title type = "plain"> 02.jpg</media: title>
<Media: description type = "plain"/>
<Media: keywords/>
<Media: thumbnail url = "http://lh3.google.com/pengpengsay/R3C96dqJBUI/AAAAAAAAAEo/j3csPO0ig7o/s72/02.JPG" Height = "48" width = "72"/>
<Media: thumbnail url = "http://lh3.google.com/pengpengsay/R3C96dqJBUI/AAAAAAAAAEo/j3csPO0ig7o/s144/02.JPG" Height = "96" width = "144"/>
<Media: thumbnail url = "http://lh3.google.com/pengpengsay/R3C96dqJBUI/AAAAAAAAAEo/j3csPO0ig7o/s288/02.JPG" Height = "192" width = "288"/>
<Media: Content url = "http://lh3.google.com/pengpengsay/R3C96dqJBUI/AAAAAAAAAEo/j3csPO0ig7o/02.JPG" Height = "400" width = "600" type = "image/JPEG" medium = "image"/>
<Media: Credit> Chenggang </media: Credit>
</Media: group>
XML address: http://picasaweb.google.com/pengpengsay/lNFxFK