Package org.w3c.dom

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


        int n = attrs.getLength();
        for (int i=0; i<n; i++) {
            root.setAttributeNode((Attr)attrs.item(i));
        }

        root.removeChild(realRoot);
    }

    /**
     * Extracts the first XSL processing instruction from the input
     * XML document.
View Full Code Here


            if (collectionElement.getAttributeNS(null, ATTRIBUTE_ID) == null | collectionElement.getAttribute(ATTRIBUTE_ID).equals("")) {
                collectionElement.setAttributeNS(null, ATTRIBUTE_ID, this.getId());
            }                  
            Element[] existingDocumentElements = helper.getChildren(collectionElement, ELEMENT_DOCUMENT);
            for (int i = 0; i < existingDocumentElements.length; i++) {
                collectionElement.removeChild(existingDocumentElements[i]);
            }
           
            collectionElement.normalize();
           
            NodeList emptyTextNodes = XPathAPI.selectNodeList(collectionElement, "text()");
View Full Code Here

            collectionElement.normalize();
           
            NodeList emptyTextNodes = XPathAPI.selectNodeList(collectionElement, "text()");
            for (int i = 0; i < emptyTextNodes.getLength(); i++) {
                Node node = emptyTextNodes.item(i);
                collectionElement.removeChild(node);
            }

            Document[] documents = getDocuments();
            for (int i = 0; i < documents.length; i++) {
                Element documentElement = createDocumentElement(documents[i], helper);
View Full Code Here

                childNodes.add(nodes.item(i));
            }
        }
        Node[] children = (Node[])childNodes.toArray(new Node[childNodes.size()]);
        for (int i = 0; i < children.length; i++){
            metaElement.removeChild(children[i])
        }

        for (int type = 0; type < 2; type++) {
            NamespaceHelper helper = new NamespaceHelper(namespaces[type], prefixes[type], doc);
            String[] elementNames = arrays[type];
View Full Code Here

      for (int i = 0; i < children.getLength(); i++) {
        existingHeadContent.add(children.item(i));
      }

      for (Node n : existingHeadContent) {
        head.removeChild(n);
      }

      // Only inject default styles if no doctype was specified.
      if (document.getDoctype() == null) {
        Element defaultStyle = document.createElement("style");
View Full Code Here

        for (int i = 0; i < children.getLength(); i++)
        {
            org.w3c.dom.Node nd = children.item(i);
            if (nd.getNodeType() == org.w3c.dom.Node.TEXT_NODE)
            {
                elem.removeChild(nd);
            }
        }

        if (value != null)
        {
View Full Code Here

            }

            // Remove all but the first Text node
            for (Iterator it = textNodes.iterator(); it.hasNext();)
            {
                elem.removeChild((org.w3c.dom.Node) it.next());
            }
            return result;
        }
    }
View Full Code Here

                }
            }

            Iterator iter = list.iterator();
            while (iter.hasNext())
                root.removeChild((Element)iter.next());

            // System.out.println("and after root is: " + root.toString());
        }
        catch (Exception e) {
            System.err.println("Error removing entry: " + e.getMessage());
View Full Code Here

            }

            // Remove all but the first Text node
            for (Iterator it = textNodes.iterator(); it.hasNext();)
            {
                elem.removeChild((org.w3c.dom.Node) it.next());
            }
            return result;
        }
    }
View Full Code Here

      Node child = list.item(i);
      element.removeChild(child);
      parent.insertBefore(child, element);
    }
   
    parent.removeChild(element);
   
  }

  /**
   * Normalize the name of attributes or node names. Allowed characters are (a-z, A-Z, 0-9, - _ .) all other
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.