public static String getAttributeValue ( final Node elementNode , final String attrName , final String defValue ) { final Node attrNode = elementNode . getAttributes ( ) . getNamedItemNS ( null , attrName ) ; if ( attrNode == null ) { return defValue ; } return attrNode . getNodeValue ( ) ; }
Helper function that uses a default value when value not set .