Package org.w3c.dom

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


        DocumentBuilder builder = XMLUtils.createDocumentBuilder(false);
        Document document = builder.parse(file);

        XMLSignature sig = new XMLSignature(document, "", "http://www.w3.org/2000/09/xmldsig#rsa-sha1");
        Element root = document.getDocumentElement();
        root.insertBefore(sig.getElement(), root.getFirstChild());

        Transforms transforms = new Transforms(document);
        transforms.addTransform(Transforms.TRANSFORM_ENVELOPED_SIGNATURE);
        transforms.addTransform(Transforms.TRANSFORM_C14N_OMIT_COMMENTS);
        sig.addDocument("", transforms, "http://www.w3.org/2000/09/xmldsig#sha1");
View Full Code Here


            Element backupElement = helper.createElement(ELEMENT_BACKUP);
            checkOutElement.appendChild(backupElement);
        }

        Element root = document.getDocumentElement();
        root.insertBefore(checkOutElement, root.getFirstChild());

        setDirty();

        // If this is a checkout, we write back the changed state
        // to the file immediately because otherwise another
View Full Code Here

               
              if (!BEFORE_SERVLET_DEF.contains(node.getNodeName())) {
                  for (Iterator it = servletElements.iterator();
                      it.hasNext(); ) {
                        Node servlet = (Node) it.next();
                        webAppNode.insertBefore(servlet, node);
                        it.remove();
                    }
                }
               
                if(!BEFORE_MAPPING_DEF.contains(node.getNodeName())) {
View Full Code Here

               
                if(!BEFORE_MAPPING_DEF.contains(node.getNodeName())) {
                  for (Iterator it = mappingElements.iterator();
                      it.hasNext(); ) {
                        Node mapping = (Node) it.next();
                        webAppNode.insertBefore(mapping, node);
                        it.remove();
                    }
                }
            }
        }
View Full Code Here

            NodeList ChildNodes = service.getChildNodes();

            Node lastConnectorNode = ChildNodes.item(ChildNodes.getLength() - 1);

            service.insertBefore(connector, lastConnectorNode);
        }


        // set attributes for the connector
        for (Entry<String, String> entry : attributesToUpdate.entrySet()) {
View Full Code Here

   
    NodeList list = parent.getChildNodes();
    for (int i = 0; i < list.getLength(); i++) {
      Node child = list.item(i);
      element.removeChild(child);
      parent.insertBefore(child, element);
    }
   
    parent.removeChild(element);
   
  }
View Full Code Here

          // add directly to actualFigure
          actualFigure.appendChild(n);
          newAccessorIndex = children.size();
        } else {
          // add to the second child
          actualFigure.insertBefore(n, children.item(1));
          newAccessorIndex = 1;
        }
       
        // we also need to add a new ChildAccess
        String newHref = "//@figures.0/@descriptors." + descriptorNumber + "/@actualFigure/@children." + children.size();
View Full Code Here

               
              if (!BEFORE_SERVLET_DEF.contains(node.getNodeName())) {
                  for (Iterator it = servletElements.iterator();
                      it.hasNext(); ) {
                        Node servlet = (Node) it.next();
                        webAppNode.insertBefore(servlet, node);
                        it.remove();
                    }
                }
               
                if(!BEFORE_MAPPING_DEF.contains(node.getNodeName())) {
View Full Code Here

               
                if(!BEFORE_MAPPING_DEF.contains(node.getNodeName())) {
                  for (Iterator it = mappingElements.iterator();
                      it.hasNext(); ) {
                        Node mapping = (Node) it.next();
                        webAppNode.insertBefore(mapping, node);
                        it.remove();
                    }
                }
            }
        }
View Full Code Here

      }
      else
      {
        final Node firstNode = docElement.getFirstChild();
        if (firstNode != null)
          docElement.insertBefore(newTitle, firstNode);
        else
          docElement.appendChild(newTitle);
      }
    }
   
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.