Exemplo n.º 1
0
 public bool TryGetDefaultAttribute(string path, string attrKey, out XmlDefaultAttribute attr)
 {
     // lookup without path 1st
     if (_DefaultAttributes.TryGetValue(attrKey, out attr))
     {
         return(true);
     }
     // else lookup with path
     return(_DefaultAttributes.TryGetValue(path + attrKey, out attr));
 }
Exemplo n.º 2
0
        private static void CompareXmlAttribute(XmlComparisonRules rules, string path, XmlAttribute a, XmlDefaultAttribute b)
        {
            if (rules.IsIgnoredPath(path))
            {
                return;
            }

            if (a.Prefix != b.Prefix)
            {
                throw new Exception(String.Format("[{0}] Attr Prefix '{1}' != '{2}'", path, a.Prefix, b.Prefix));
            }

            if (a.LocalName != b.LocalName)
            {
                throw new Exception(String.Format("[{0}] Attr LocalName '{1}' != '{2}'", path, a.LocalName, b.LocalName));
            }

            if (a.Value != b.Value)
            {
                throw new Exception(String.Format("[{0}] Attr Value '{1}' != '{2}'", path, a.Value, b.Value));
            }
        }