Package org.w3c.dom

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


            Node importNode = elem;
            ns.add(importNode);
        }
        for (Node item : ns) {
            Node schemaNode = item.getParentNode();
            schemaNode.removeChild(item);
        }

        incElemList = DOMUtils.findAllElementsByTagNameNS(element,
                                                          "http://www.w3.org/2001/XMLSchema",
                                                          "include");
View Full Code Here


                //
                // The new document doesn't contain the RDF element of interest
                // so remove it from the old document.
                //
                final Node parent = oldRDFDirElement.getParentNode();
                parent.removeChild( oldRDFDirElement );
            }
            return;
        }

        final Document oldDocument = oldRDFElement.getOwnerDocument();
View Full Code Here

            nodesToBeRemoved.add(nl.item(i));
        }
        for (Node n : nodesToBeRemoved) {
            Node parent = n.getParentNode();
            if (parent != null) {
                parent.removeChild(n);
            }
        }
    }

    /**
 
View Full Code Here

    NodeImpl child = (NodeImpl) newChild;
    NodeImpl next = (NodeImpl) refChild;
    NodeImpl prev = null;
    Node oldParent = child.getParentNode();
    if (oldParent != null)
      oldParent.removeChild(child);
    if (next == null) {
      prev = this.lastChild;
      this.lastChild = child;
    } else {
      prev = (NodeImpl) next.getPreviousSibling();
View Full Code Here

        } 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

        } else {

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

            node.appendChild(node.getOwnerDocument().createTextNode(value));
        }
    }
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

  }

  // Remove the node from the tree
  Node np = n.getParentNode();
  if (np != null) {
      np.removeChild(n);
  }
    }

    /**
     * To manage a list of nodes.
View Full Code Here

    if (!needsFeature) {
      templateContext.getGadget().removeFeature(TEMPLATES_FEATURE_NAME);
      for (Element template : allTemplates) {
        Node parent = template.getParentNode();
        if (parent != null) {
          parent.removeChild(template);
        }
      }
    } else {
      // If the feature is to be kept, inject the libraries.
      // Library assets will be generated on the client.
View Full Code Here

            Node importNode = elem;
            ns.add(importNode);
        }
        for (Node item : ns) {
            Node schemaNode = item.getParentNode();
            schemaNode.removeChild(item);
        }
        return element;
    }

    public Node cloneNode(Document document, Node node, boolean deep) throws DOMException {
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.