@ Deprecated protected final boolean areAttributesComparable ( Element control , Element test ) { String controlValue , testValue ; Attr [ ] qualifyingAttributes ; NamedNodeMap namedNodeMap = control . getAttributes ( ) ; if ( matchesAllAttributes ( qualifyingAttrNames ) ) { qualifyingAttributes = new Attr [ namedNodeMap . getLength ( ) ] ; for ( int n = 0 ; n < qualifyingAttributes . length ; ++ n ) { qualifyingAttributes [ n ] = ( Attr ) namedNodeMap . item ( n ) ; } } else { qualifyingAttributes = new Attr [ qualifyingAttrNames . length ] ; for ( int n = 0 ; n < qualifyingAttrNames . length ; ++ n ) { qualifyingAttributes [ n ] = ( Attr ) namedNodeMap . getNamedItem ( qualifyingAttrNames [ n ] ) ; } } String nsURI , name ; for ( int i = 0 ; i < qualifyingAttributes . length ; ++ i ) { if ( qualifyingAttributes [ i ] != null ) { nsURI = qualifyingAttributes [ i ] . getNamespaceURI ( ) ; controlValue = qualifyingAttributes [ i ] . getNodeValue ( ) ; name = qualifyingAttributes [ i ] . getName ( ) ; } else { // cannot be "*" case nsURI = controlValue = "" ; name = qualifyingAttrNames [ i ] ; } if ( nsURI == null || nsURI . length ( ) == 0 ) { testValue = test . getAttribute ( name ) ; } else { testValue = test . getAttributeNS ( nsURI , qualifyingAttributes [ i ] . getLocalName ( ) ) ; } if ( controlValue == null ) { if ( testValue != null ) { return false ; } } else { if ( ! controlValue . equals ( testValue ) ) { return false ; } } } return true ; }
Determine whether the qualifying attributes are present in both elements and if so whether their values are the same