// Collection of code snippets by Arne Vajhøj // (likely posted to comp.os.vms/INFO-VAX, INFO-TPU, MACRO32, eksperten.dk, newz.dk, LinkedIn or other place sometime between 1990 and now) using System; using System.Xml; using Sgml; namespace E { public class Program { public static void Main(string[] args) { SgmlReader r = new SgmlReader(); r.Href = "http://www.microsoft.com/en/us/default.aspx"; XmlDocument doc = new XmlDocument(); doc.Load(r); XmlNamespaceManager nsm = new XmlNamespaceManager(doc.NameTable); nsm.AddNamespace("defns", "http://www.w3.org/1999/xhtml"); XmlNode n = doc.SelectSingleNode("/defns:html/defns:body[@class='ltr']/defns:form[@id='aspnetForm']/defns:div[@class='h15-bottom' and position()=2]/defns:div[@class='h15-header' and position()=1]/defns:div[@class='h15-header-inner' and @id='hpToolbar']/defns:strong[@class='h15-country']/text()", nsm); Console.WriteLine(n.Value); } } }