/** * <b>DOM</b>: Implements {@link org.w3c.dom.Node#getNodeValue()}. * @return The content of the attribute. */ public String getNodeValue() throws DOMException { Node first = getFirstChild(); if (first == null) { return ""; } Node n = first.getNextSibling(); if (n == null) { return first.getNodeValue(); } StringBuffer result = new StringBuffer(first.getNodeValue()); do { result.append(n.getNodeValue()); n = n.getNextSibling(); } while (n != null); return result.toString(); }
/** * <b>DOM</b>: Implements {@link org.w3c.dom.Node#getNodeValue()}. * @return The content of the attribute. */ public String getNodeValue() throws DOMException { Node first = getFirstChild(); if (first == null) { return ""; } Node n = first.getNextSibling(); if (n == null) { return first.getNodeValue(); } StringBuffer result = new StringBuffer(first.getNodeValue()); do { result.append(n.getNodeValue()); n = n.getNextSibling(); } while (n != null); return result.toString(); }
/** * <b>DOM</b>: Implements {@link org.w3c.dom.Node#getNodeValue()}. * @return The content of the attribute. */ public String getNodeValue() throws DOMException { Node first = getFirstChild(); if (first == null) { return ""; } Node n = first.getNextSibling(); if (n == null) { return first.getNodeValue(); } StringBuffer result = new StringBuffer(first.getNodeValue()); do { result.append(n.getNodeValue()); n = n.getNextSibling(); } while (n != null); return result.toString(); }
/** * <b>DOM</b>: Implements {@link org.w3c.dom.Node#setNodeValue(String)}. */ public void setNodeValue(String nodeValue) throws DOMException { if (isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] { new Integer(getNodeType()), getNodeName() }); } String s = getNodeValue(); // Remove all the children Node n; while ((n = getFirstChild()) != null) { removeChild(n); } String val = (nodeValue == null) ? "" : nodeValue; // Create and append a new child. n = getOwnerDocument().createTextNode(val); appendChild(n); if (ownerElement != null) { ownerElement.fireDOMAttrModifiedEvent(nodeName, this, s, val, MutationEvent.MODIFICATION); } }
/** * <b>DOM</b>: Implements {@link org.w3c.dom.Node#setNodeValue(String)}. */ public void setNodeValue(String nodeValue) throws DOMException { if (isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] {(int) getNodeType(), getNodeName() }); } String s = getNodeValue(); // Remove all the children Node n; while ((n = getFirstChild()) != null) { removeChild(n); } String val = (nodeValue == null) ? "" : nodeValue; // Create and append a new child. n = getOwnerDocument().createTextNode(val); appendChild(n); if (ownerElement != null) { ownerElement.fireDOMAttrModifiedEvent(nodeName, this, s, val, MutationEvent.MODIFICATION); } }
/** * <b>DOM</b>: Implements {@link org.w3c.dom.Node#setNodeValue(String)}. */ public void setNodeValue(String nodeValue) throws DOMException { if (isReadonly()) { throw createDOMException(DOMException.NO_MODIFICATION_ALLOWED_ERR, "readonly.node", new Object[] {(int) getNodeType(), getNodeName() }); } String s = getNodeValue(); // Remove all the children Node n; while ((n = getFirstChild()) != null) { removeChild(n); } String val = (nodeValue == null) ? "" : nodeValue; // Create and append a new child. n = getOwnerDocument().createTextNode(val); appendChild(n); if (ownerElement != null) { ownerElement.fireDOMAttrModifiedEvent(nodeName, this, s, val, MutationEvent.MODIFICATION); } }