Package org.apache.axiom.core

Examples of org.apache.axiom.core.CoreChildNode


    /** Replaces the oldChild with the newChild. */
    public final Node replaceChild(Node newChild, Node _oldChild) throws DOMException {
        if (!(_oldChild instanceof CoreChildNode)) {
            throw newDOMException(DOMException.NOT_FOUND_ERR);
        }
        CoreChildNode oldChild = (CoreChildNode)_oldChild;
        if (oldChild.coreGetParent() != this) {
            throw newDOMException(DOMException.NOT_FOUND_ERR);
        }
        checkNewChild(newChild, _oldChild);
        CoreChildNode nextSibling = oldChild.coreGetNextSibling();
        oldChild.coreDetach(coreGetOwnerDocument(true));
        if (newChild instanceof CoreChildNode) {
            if (nextSibling == null) {
                coreAppendChild((CoreChildNode)newChild, false);
            } else {
                nextSibling.coreInsertSiblingBefore((CoreChildNode)newChild);
            }
        } else if (newChild instanceof CoreDocumentFragment) {
            if (nextSibling == null) {
                coreAppendChildren((CoreDocumentFragment)newChild);
            } else {
                nextSibling.coreInsertSiblingsBefore((CoreDocumentFragment)newChild);
            }
        } else {
            throw newDOMException(DOMException.HIERARCHY_REQUEST_ERR);
        }
        return _oldChild;
View Full Code Here

TOP

Related Classes of org.apache.axiom.core.CoreChildNode

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.