oldChild with newChild in the list of children, and returns the oldChild node. newChild is a DocumentFragment object, oldChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed. Note: Replacing a node with itself is implementation dependent.
@param newChild The new node to put in the child list.
@param oldChild The node being replaced in the list.
@return The node replaced.
@exception DOMException HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to put in is one of this node's ancestors or this node itself, or if this node is of type Document and the result of the replacement operation would add a second DocumentType or Element on the Document node.
WRONG_DOCUMENT_ERR: Raised if newChild was created from a different document than the one that created this node.
NO_MODIFICATION_ALLOWED_ERR: Raised if this node or the parent of the new node is readonly.
NOT_FOUND_ERR: Raised if oldChild is not a child of this node.
NOT_SUPPORTED_ERR: if this node is of type Document, this exception might be raised if the DOM implementation doesn't support the replacement of the DocumentType child or Element child.
@since DOM Level 3
Replaces an existing child with a new child node. If oldChild is not a child of this node, then a NoSuchChildException is thrown. The root element can only be replaced by another element.
newChild alreadyhas a parent
@throws NoSuchChildException if oldChild is not a child of this node
@throws NullPointerException if either argument is null
@throws IllegalAddException if newChild is anattribute or a text node
@throws WellformednessException if newChild oldChild is an element and newChild is not
Replaces an existing child with a new child node. If oldChild is not a child of this node, then a NoSuchChildException is thrown.
newChild alreadyhas a parent
@throws NoSuchChildException if oldChild is not a child of this node
@throws NullPointerException if either argument is null
@throws IllegalAddException if this node cannot have children of the type of newChild
oldChild with newChild in the list of children, and returns the oldChild node. newChild is a DocumentFragment object, oldChild is replaced by all of the DocumentFragment children, which are inserted in the same order. If the newChild is already in the tree, it is first removed.
@param newChild The new node to put in the child list.
@param oldChild The node being replaced in the list.
@return The node replaced.
@exception DOMException HIERARCHY_REQUEST_ERR: Raised if this node is of a type that does not allow children of the type of the newChild node, or if the node to put in is one of this node's ancestors. newChild was created from a different document than the one that created this node. oldChild is not a child of this node.
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |