File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed
Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -560,19 +560,27 @@ private static bool CompareElements(
560560 }
561561 if ( matchedEnough )
562562 {
563- foreach ( var attr in originalAttributes . Keys )
563+ foreach ( var attr in originalAttributes )
564564 {
565- if ( ! modifiedAttributes . ContainsKey ( attr ) )
565+ if ( ! modifiedAttributes . ContainsKey ( attr . Key ) )
566566 {
567- Logger . Debug ( $ "Modified attributes does not contain key '{ attr } '.") ;
567+ Logger . Debug ( $ "Modified attributes does not contain key '{ attr . Key } '.") ;
568568 if ( checkOnly )
569569 {
570570 Logger . Debug (
571571 $ "Attribute '{ attr } ' from { GetElementInfo ( originalChild ) } not exists in { GetElementInfo ( modifiedChild ) } check only mode. Returning true."
572572 ) ;
573573 return true ;
574574 }
575- matchedEnough = false ;
575+ differencesInAttributesCount ++ ;
576+ if ( differencesInAttributesCount > 1 || originalAttributes . Count == 1 )
577+ {
578+ differencesInAttributesCount ++ ;
579+ matchedEnough = false ;
580+ break ;
581+ }
582+ string sel = $ "{ GenerateXPath ( originalChild , pathOptions ) } /@{ attr . Key } ";
583+ savedOp = new XElement ( "remove" , new XAttribute ( "sel" , sel ) ) ;
576584 break ;
577585 }
578586 }
You can’t perform that action at this time.
0 commit comments