/** * Update Status Monitor Parameter * * @param param parameter to replace * @throws XPathExpressionException */ public void updateStatParameter(PhoneLabParameter param) throws XPathExpressionException { Element statusElement = (Element) xpath.evaluate("/manifest/statusmonitor", document, XPathConstants.NODE); Node pNode = (Node) xpath.evaluate( "parameter[@name='" + param.getName() + "']", statusElement, XPathConstants.NODE); statusElement.removeChild(pNode); Element newElement = document.createElement("parameter"); if (param.getUnits() != null) newElement.setAttribute("units", param.getUnits()); if (param.getValue() != null) newElement.setAttribute("value", param.getValue()); if (param.getSetBy() != null) newElement.setAttribute("set_by", param.getSetBy()); statusElement.appendChild(newElement); }