标签:cat namespace path adl string head htm ring names
XmlDocument doc = new XmlDocument();
doc.Load(localxml + "\\" + Path.GetFileName(xinhuaxml));
System.Xml.XmlElement root = doc.DocumentElement;
string namespaces = root.NamespaceURI;
System.Xml.XmlNamespaceManager nsMgr = new System.Xml.XmlNamespaceManager(doc.NameTable);
nsMgr.AddNamespace("apxh", "http://www.w3.org/1999/xhtml");
nsMgr.AddNamespace("apcm", "http://ap.org/schemas/03/2005/apcm");
nsMgr.AddNamespace("ns", namespaces);
string creattime = root.SelectSingleNode(@"//ns:updated", nsMgr).InnerText;
string headlinetxt = root.SelectSingleNode(@"//apcm:SlugLine", nsMgr).InnerText;
string category = root.SelectSingleNode(@"//ns:category", nsMgr).InnerText;
XmlNode content = root.SelectSingleNode(@"//ns:content", nsMgr);
标签:cat namespace path adl string head htm ring names
原文地址:http://www.cnblogs.com/ssjsk/p/6053952.html