static void changeParameterChild ( Element node , String name , String value ) { if ( node != null ) { boolean foundIt = false ; for ( Element parm = ( Element ) node . getFirstChild ( ) ; parm != null ; parm = ( Element ) parm . getNextSibling ( ) ) { Attr att = parm . getAttributeNode ( Constants . ATT_NAME ) ; if ( att != null && att . getValue ( ) . equals ( name ) ) { parm . setAttribute ( Constants . ATT_VALUE , value ) ; foundIt = true ; break ; } } if ( ! foundIt ) // if didn't find it add a new one LPAAddParameter . addParameterChild ( node , name , value ) ; } }
Look in the passed - in element for a parameter child element whose value is to be changed to the passed - in value .