Package org.w3c.dom

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


                            attr.setNodeValue(DOMUtil.getValueOfNode(fragment));
                        } else {

                            // remove old childs
                            while (node.hasChildNodes() == true) {
                                node.removeChild(node.getFirstChild());
                            }

                            // Insert new childs
                            NodeList childs = fragment.getChildNodes();
                            if (childs != null && childs.getLength() > 0) {
View Full Code Here


                                    visibleElem = statusElem.getOwnerDocument().createElementNS(null, "visible");
                                    statusElem.appendChild(visibleElem);
                                }
                                // remove old childs
                                while (visibleElem.hasChildNodes() == true) {
                                    visibleElem.removeChild(visibleElem.getFirstChild());
                                }
                                visibleElem.appendChild(statusElem.getOwnerDocument().createTextNode("true"));
                            }
                        }
                    }
View Full Code Here

                        NodeList childs = currentProfile.getChildNodes();
                        int      index, max;
                        max = childs.getLength();
                        for(index = max - 1; index >= 0; index--) {
                            if (childs.item(index).getNodeType() == Node.TEXT_NODE) {
                                currentProfile.removeChild(childs.item(index));
                            }
                        }
                        childs = currentDelta.getChildNodes();
                        max = childs.getLength();
                        for(index = 0; index < max; index++) {
View Full Code Here

                nodes = XPathAPI.selectNodeList(configuration, xpath);

                for (int i = 0, length = nodes.getLength(); i < length; i++) {
                    Node node = nodes.item(i);
                    Node parent = node.getParentNode();
                    parent.removeChild(node);
                }
            }

            // Test for an attribute that needs to be added to an element
            String name = component.getDocumentElement().getAttribute("add-attribute");
View Full Code Here

        NodeList nl = doc.getElementsByTagNameNS("http://www.w3.org/2000/09/xmldsig#", "Signature");
        for (int i = 0; i < nl.getLength(); i++) {
            Node n = nl.item(i);
            Node parent = n.getParentNode();
            if (parent != null) {
                parent.removeChild(n);
            }
        }
    }

    /**
 
View Full Code Here

     */
    public void deleteFirstCheckIn() throws Exception {
        XPointerFactory xpf = new XPointerFactory();
        Node root = document.getDocumentElement();
        Vector firstCheckIn = xpf.select(root, "xpointer(/XPSRevisionControl/CheckIn[1])");
        root.removeChild((Node) firstCheckIn.elementAt(0));
        root.removeChild(root.getFirstChild()); // remove EOL (end of line)
        setDirty();
    }

    /**
 
View Full Code Here

    public void deleteFirstCheckIn() throws Exception {
        XPointerFactory xpf = new XPointerFactory();
        Node root = document.getDocumentElement();
        Vector firstCheckIn = xpf.select(root, "xpointer(/XPSRevisionControl/CheckIn[1])");
        root.removeChild((Node) firstCheckIn.elementAt(0));
        root.removeChild(root.getFirstChild()); // remove EOL (end of line)
        setDirty();
    }

    /**
     * get the time's value of the backups
View Full Code Here

     * @see org.apache.lenya.cms.publication.SiteTree#deleteNode(java.lang.String)
     */
    public void deleteNode(String documentId) throws SiteTreeException {
        Node node = this.getNodeInternal(documentId);
        Node parentNode = node.getParentNode();
        parentNode.removeChild(node);
    }


    /**
     * removes the node corresponding to the given document-id
View Full Code Here

            if (profiles != null && Collections.disjoint(activeProfiles, profiles))
            {
               Node parent = elt.getParentNode();

               // Remove it
               parent.removeChild(elt);

               // No more processing
               return;
            }
View Full Code Here

        }
        if (node instanceof Node) {
            Node nodeObj = (Node) node;
            Node parentNode = nodeObj.getParentNode();
            if (parentNode != null) {
                parentNode.removeChild(nodeObj);
            }
        }
    }

    /**
 
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.