Package org.w3c.dom

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


            }
            Element clonedElmt = (Element) targetElmt.cloneNode(true);
            Node refChild = clonedElmt.getFirstChild();
            Document clonedDocument = clonedElmt.getOwnerDocument();
            for (int i = 0; i < siblingNodes.size(); i++) {
                clonedElmt.insertBefore(clonedDocument.importNode((Node) siblingNodes.get(i), true), refChild);
            }
            return clonedElmt;
        }
    }
View Full Code Here


                refChild = null;
            } else {
                refChild = children.item(position + 1);
            }
            for (int i = 0; i < childNodes.size(); i++) {
                clonedElmt.insertBefore((Node) childNodes.get(i), refChild);
            }
            return clonedElmt;
        }
    }
View Full Code Here

            Element clonedElmt = (Element) parentElmt.cloneNode(true);
            children = clonedElmt.getChildNodes();
            Node refChild = (position < children.getLength()) ? children.item(position) : null;
            Document clonedDocument = clonedElmt.getOwnerDocument();
            for (int i = 0; i < siblingNodes.size(); i++) {
                clonedElmt.insertBefore(clonedDocument.importNode((Node) siblingNodes.get(i), true), refChild);
            }
            return clonedElmt;
        }
    }
View Full Code Here

            Element clonedElmt = (Element) parentElmt.cloneNode(true);
            children = clonedElmt.getChildNodes();
            Node refChild = (position <= children.getLength()) ? children.item(position - 1) : null;
            Document clonedDocument = clonedElmt.getOwnerDocument();
            for (int i = 0; i < siblingNodes.size(); i++) {
                clonedElmt.insertBefore(clonedDocument.importNode((Node) siblingNodes.get(i), true), refChild);
            }
            return clonedElmt;
        }
    }
View Full Code Here

        Element newReferenceElement = (Element) xPathExpression.evaluate(clonedEncryptedElement, XPathConstants.NODE);
        newReferenceElement.removeAttribute("URI");
        newReferenceElement.setAttributeNS(null, "URI", "#G2");

        Element securityHeaderNode = (Element) encryptedKeyElement.getParentNode();
        securityHeaderNode.insertBefore(clonedEncryptedElement, encryptedKeyElement);

        ByteArrayOutputStream baos = new ByteArrayOutputStream();

        javax.xml.transform.Transformer transformer = TRANSFORMER_FACTORY.newTransformer();
        transformer.transform(new DOMSource(securedDocument), new StreamResult(baos));
View Full Code Here

   
            if (headerComment != null)
            {
                Element root = _doc.getDocumentElement();
                Comment comment = _doc.createComment(headerComment);
                root.insertBefore(comment, root.getFirstChild());
            }
        }
        catch (ParserConfigurationException e)
        {
            throw new XmlModelWriterException(e);
View Full Code Here

              refChild = null;
            } else {
              refChild = children.item(position + 1);
            }
            for (int i = 0; i < childNodes.size(); i++) {
              clonedElmt.insertBefore((Node) childNodes.get(i), refChild);
            }
            return clonedElmt;
      }
    }
   
View Full Code Here

            Element clonedElmt = (Element) parentElmt.cloneNode(true);
            children = clonedElmt.getChildNodes();
            Node refChild = (position < children.getLength()) ? children.item(position) : null;
            Document clonedDocument = clonedElmt.getOwnerDocument();
            for (int i = 0; i < siblingNodes.size(); i++) {
              clonedElmt.insertBefore(clonedDocument.importNode((Node) siblingNodes.get(i), true), refChild);
            }
            return clonedElmt;
      }
    }
   
View Full Code Here

            Element clonedElmt = (Element) parentElmt.cloneNode(true);
            children = clonedElmt.getChildNodes();
            Node refChild = (position <= children.getLength()) ? children.item(position - 1) : null;
            Document clonedDocument = clonedElmt.getOwnerDocument();
            for (int i = 0; i < siblingNodes.size(); i++) {
              clonedElmt.insertBefore(clonedDocument.importNode((Node) siblingNodes.get(i), true), refChild);
            }
            return clonedElmt;
      }
    }
View Full Code Here

            }
            Element clonedElmt = (Element) targetElmt.cloneNode(true);
            Node refChild = clonedElmt.getFirstChild();
            Document clonedDocument = clonedElmt.getOwnerDocument();
            for (int i = 0; i < siblingNodes.size(); i++) {
              clonedElmt.insertBefore(clonedDocument.importNode((Node) siblingNodes.get(i), true), refChild);
            }
            return clonedElmt;
      }
    }
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.