/** * Replaces the content of a tag. * @param namespaceURI the URI of the namespace * @param localName the tag name * @param value the new content for the tag * @return true if the content was successfully replaced * @since 2.1.6 the return type has changed from void to boolean */ public boolean replace(String namespaceURI, String localName, String value) { NodeList nodes = domDocument.getElementsByTagNameNS(namespaceURI, localName); Node node; if (nodes.getLength() == 0) return false; for (int i = 0; i < nodes.getLength(); i++) { node = nodes.item(i); setNodeText(domDocument, node, value); } return true; }
/** * Replaces the content of a tag. * @param namespaceURI the URI of the namespace * @param localName the tag name * @param value the new content for the tag * @return true if the content was successfully replaced * @since 2.1.6 the return type has changed from void to boolean */ public boolean replace(String namespaceURI, String localName, String value) { NodeList nodes = domDocument.getElementsByTagNameNS(namespaceURI, localName); Node node; if (nodes.getLength() == 0) return false; for (int i = 0; i < nodes.getLength(); i++) { node = nodes.item(i); setNodeText(domDocument, node, value); } return true; }
/** * Replaces the content of a tag. * @param namespaceURI the URI of the namespace * @param localName the tag name * @param value the new content for the tag * @return true if the content was successfully replaced * @since 2.1.6 the return type has changed from void to boolean */ public boolean replace(String namespaceURI, String localName, String value) { NodeList nodes = domDocument.getElementsByTagNameNS(namespaceURI, localName); Node node; if (nodes.getLength() == 0) return false; for (int i = 0; i < nodes.getLength(); i++) { node = nodes.item(i); setNodeText(domDocument, node, value); } return true; }