/// <summary> /// /// </summary> /// <param name="path"></param> /// <param name="attrKey"></param> /// <param name="attr"></param> /// <returns></returns> 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)); }
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($"[{path}] Attr Prefix '{a.Prefix}' != '{b.Prefix}'"); } if (a.LocalName != b.LocalName) { throw new Exception($"[{path}] Attr LocalName '{a.LocalName}' != '{b.LocalName}'"); } if (a.Value != b.Value) { throw new Exception($"[{path}] Attr Value '{a.Value}' != '{b.Value}'"); } }