private static String getAttribute ( String name , Element firstElement , Element secondElement ) { String val = firstElement . getAttribute ( name ) ; if ( val . length ( ) == 0 && secondElement != null ) { val = secondElement . getAttribute ( name ) ; } return val ; }
Try to get an attribute value from two elements .