code: public static String getAttribute( Element node, String key, String def )
      {
          if( null == node )
          {
              return def;
          }
          String value = node.getAttribute( key );
          if( null == value )
          {
              return def;
          }
          if( "".equals( value ) )
          {
              return def;
          }
          return normalize( value );
      }
docs: Return the value of an element attribute.
  
  @param node the DOM node
  @param key  the attribute key
  @param def  the default value if the attribute is undefined
  
  @return the attribute value or the default value if undefined