Package org.w3c.dom

Examples of org.w3c.dom.Node.insertBefore()


                Node next = fStartContainer.getNextSibling();
                if (next != null) {
                    Node parent = fStartContainer.getParentNode();
                    if (parent !=  null) {
                        parent.insertBefore(newNode, next);
                        parent.insertBefore(cloneCurrent, next);
                    }
                } else {
                    Node parent = fStartContainer.getParentNode();
                    if (parent != null) {
                        parent.appendChild(newNode);
View Full Code Here


                    Element newChannelElement = node.getXML(uld);
                    Element oldChannelElement = (Element) uld.getElementById( nodeId );
                    Node parent = oldChannelElement.getParentNode();
                    parent.removeChild( oldChannelElement );
                    parent.insertBefore( newChannelElement, nextSibling );
                    // register new child instead
                    newChannelElement.setIdAttribute(Constants.ATT_ID, true);

                    // inform the listeners
                    LayoutEvent ev=new LayoutEvent( this, node);
View Full Code Here

                        newFolderElement.appendChild((Node)children.get(i));
                    }

                    // replace the actual node
                    parent.removeChild(oldFolderElement);
                    parent.insertBefore(newFolderElement,nextSibling);
                    // register new child instead
                    newFolderElement.setIdAttribute(Constants.ATT_ID, true);

                    // inform the listeners
                    LayoutEvent ev=new LayoutEvent(this,node);
View Full Code Here

                    // generate new XML Element
                    Element newChannelElement=node.getXML(ulm);
                    Element oldChannelElement=(Element)ulm.getElementById(nodeId);
                    Node parent=oldChannelElement.getParentNode();
                    parent.removeChild(oldChannelElement);
                    parent.insertBefore(newChannelElement,nextSibling);
                   
                    // register new child instead
                    newChannelElement.setIdAttribute("ID", true);
                    newChannelElement.setAttribute("ID",node.getId());
View Full Code Here

                        newFolderElement.appendChild((Node)children.get(i));
                    }

                    // replace the actual node
                    parent.removeChild(oldFolderElement);
                    parent.insertBefore(newFolderElement,nextSibling);
                   
                    // register new child instead
                    newFolderElement.setIdAttribute("ID", true);
                     newFolderElement.setAttribute("ID",node.getId());
View Full Code Here

        if (last != document) {
            final String text = new String(ch, start, length);
            if (lastSibling != null && lastSibling.getNodeType() == Node.TEXT_NODE) {
                ((Text)lastSibling).appendData(text);
            } else if (last == root && nextSibling != null) {
                lastSibling = last.insertBefore(document.createTextNode(text), nextSibling);
            } else {
                lastSibling = last.appendChild(document.createTextNode(text));
            }

        }
View Full Code Here

        Node last = nodeStk.peek();

        // If the SAX2DOM is created with a non-null next sibling node,
        // insert the result nodes before the next sibling under the root.
        if (last == root && nextSibling != null) {
            last.insertBefore(tmp, nextSibling);
        } else {
            last.appendChild(tmp);
        }

        // Push this node onto stack
View Full Code Here

    public void processingInstruction(String target, String data) {
        final Node last = nodeStk.peek();
        ProcessingInstruction pi = document.createProcessingInstruction(target, data);
        if (pi != null) {
            if (last == root && nextSibling != null) {
                last.insertBefore(pi, nextSibling);
            } else {
                last.appendChild(pi);
            }

            lastSibling = pi;
View Full Code Here

    public void comment(char[] ch, int start, int length) {
        final Node last = nodeStk.peek();
        Comment comment = document.createComment(new String(ch, start, length));
        if (comment != null) {
            if (last == root && nextSibling != null) {
                last.insertBefore(comment, nextSibling);
            } else {
                last.appendChild(comment);
            }

            lastSibling = comment;
View Full Code Here

        setNodeValue(data.substring(0, offset));

        // insert new text node
        Node parentNode = getParentNode();
        if (parentNode != null) {
            parentNode.insertBefore(newText, nextSibling);
        }

        return newText;

    } // splitText(int):Text
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.