Package org.w3c.dom

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


        Element wsseHeader = getFirstChildElement(sh,
                                                  new QName(
                                                            "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd",
                                                            "Security"), true);

        Node newWsseHeader = wsseHeader.cloneNode(false);
        Node cur = wsseHeader.getFirstChild();
        String newId = newEncData.getAttributeNS(null, "Id");
        while (cur != null) {
            cur = copyHeadersAndUpdateRefList(cur, newWsseHeader, newId);
        }
View Full Code Here


        Element wsseHeader = getFirstChildElement(saaj,
                                                  new QName(
                                                            "http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd",
                                                            "Security"), true);

        Node newWsseHeader = wsseHeader.cloneNode(false);
        Node cur = wsseHeader.getFirstChild();

        while (cur != null) {
            cur = copyHeadersAndUpdateRefList(cur, newWsseHeader, newId);
        }
View Full Code Here

                    encData.setKeyInfo(keyInfo);
                    xmlCipher.doFinal(doc, body, content);
                   
                    Element encDataElem = WSSecurityUtil.findElementById(document
                            .getDocumentElement(), xencEncryptedDataId, null);
                    Node clone = encDataElem.cloneNode(true);
                    elem.appendChild(clone);
                    encDataElem.getParentNode().appendChild(elem);
                    encDataElem.getParentNode().removeChild(encDataElem);
                   
                } else {
View Full Code Here

        Date createdDate = new Date();
        long currentTime = createdDate.getTime() + 300000;
        createdDate.setTime(currentTime);
        elementCreated.appendChild(doc.createTextNode(zulu.format(createdDate)));
        timestampElement.appendChild(elementCreated);
        timestampElement.appendChild(elementCreated.cloneNode(true));

        secHeader.getSecurityHeader().appendChild(timestampElement);
       
        if (LOG.isDebugEnabled()) {
            String outputString =
View Full Code Here

        Date createdDate = new Date();
        long currentTime = createdDate.getTime() + 300000;
        createdDate.setTime(currentTime);
        elementCreated.appendChild(doc.createTextNode(zulu.format(createdDate)));
        timestampElement.appendChild(elementCreated);
        timestampElement.appendChild(elementCreated.cloneNode(true));

        secHeader.getSecurityHeader().appendChild(timestampElement);
       
        if (LOG.isDebugEnabled()) {
            String outputString =
View Full Code Here

                  pos).trim() : label;
              String lastName = (pos > 0) ? label.substring(
                  pos + 1, label.length()).trim() : "";

              // Clones the value for correct undo/redo
              elt = (Element) elt.cloneNode(true);

              elt.setAttribute("firstName", firstName);
              elt.setAttribute("lastName", lastName);

              newValue = elt;
View Full Code Here

    private static Element createFromKey(DomElementKey key) {
        Element value = mock(Element.class);
        stub(value.getTagName()).toReturn(key.getName());
        stub(value.getNamespaceURI()).toReturn(key.getNamespace());
        stub(value.cloneNode(anyBoolean())).toReturn(value);
        return value;
    }

    @Test
    public void testGetConfigurationFragmentRightAfterSet() throws Exception {
View Full Code Here

      String tag = "-clone";
      String suffix = String.format(nodeNamingConvention, tag, Integer.toHexString(new SecureRandom().nextInt(4095)));
      builder.xpathFind("//domain/name").t(suffix);
      // change uuid domain
      Element oldChild = builder.xpathFind("//domain/uuid").getElement();
      Node newNode = oldChild.cloneNode(true);
      newNode.getFirstChild().setNodeValue(UUID.randomUUID().toString());
      builder.getDocument().getDocumentElement().replaceChild(newNode, oldChild);

      // String fromVolPath =
      // builder.xpathFind("//domain/devices/disk/source").getElement().getAttribute("file");
View Full Code Here

                // copy status
                Element configElement = this.getCopletConfiguration(copletID,
                                                      (Map)theProfile.get(PortalConstants.PROFILE_DEFAULT_COPLETS),
                                                      (Map)theProfile.get(PortalConstants.PROFILE_MEDIA_COPLETS));
                Element configStatus = (Element)DOMUtil.getFirstNodeFromPath(configElement, new String[] {"status"}, false);
                copletNode.appendChild(configStatus.cloneNode(true));

                // clear type information for each status
                Element status = (Element)copletNode.getElementsByTagName("status").item(0);
                NodeList parameters = status.getChildNodes();
                Node    current;
View Full Code Here

                   
                    Element encDataElem =
                        WSSecurityUtil.findElementById(
                            document.getDocumentElement(), xencEncryptedDataId, null
                        );
                    Node clone = encDataElem.cloneNode(true);
                    elem.appendChild(clone);
                    encDataElem.getParentNode().appendChild(elem);
                    encDataElem.getParentNode().removeChild(encDataElem);
                } else {
                    xmlCipher.init(XMLCipher.ENCRYPT_MODE, secretKey);
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.