private String getRequiredAttribute ( Element node , String name ) { String value = node . getAttribute ( name ) ; if ( value . isEmpty ( ) ) { throw new IllegalArgumentException ( "Missing " + name + " attribute on node: " + node . getTagName ( ) ) ; } return value ; }
Returns the value of the named attribute from a DOM node throwing an exception if not found .