HtmlAgilityPack.HtmlWeb.GetCacheHeader C# (CSharp) Method

GetCacheHeader() private method

private GetCacheHeader ( Uri requestUri, string name, string def ) : string
requestUri System.Uri
name string
def string
return string
        private string GetCacheHeader(Uri requestUri, string name, string def)
        {
            // note: some headers are collection (ex: www-authenticate)
            // we don't handle that here
            XmlDocument doc = new XmlDocument();
            doc.Load(GetCacheHeadersPath(requestUri));
            XmlNode node =
                doc.SelectSingleNode("//h[translate(@n, 'abcdefghijklmnopqrstuvwxyz','ABCDEFGHIJKLMNOPQRSTUVWXYZ')='" +
                                     name.ToUpper() + "']");
            if (node == null)
            {
                return def;
            }
            // attribute should exist
            return node.Attributes[name].Value;
        }