Examples of adoptNode()


Examples of org.w3c.dom.Document.adoptNode()

                                                    String referenceId,
                                                    String sigAlgo) throws Exception {
        Element docEl = doc.getDocumentElement();
        Document newDoc = DOMUtils.createDocument();
        doc.removeChild(docEl);
        newDoc.adoptNode(docEl);
        Element object = newDoc.createElementNS(Constants.SignatureSpecNS, "ds:Object");
        object.appendChild(docEl);
        object.setAttribute("ID", id);
       
        XMLSignature sig = new XMLSignature(newDoc, "", sigAlgo);
View Full Code Here

Examples of org.w3c.dom.Document.adoptNode()

            String referenceId,
            String sigAlgo) throws Exception {
        Element docEl = doc.getDocumentElement();
        Document newDoc = DOMUtils.createDocument();
        doc.removeChild(docEl);
        newDoc.adoptNode(docEl);
        docEl.setAttribute("ID", id);
       
        Element root = newDoc.createElementNS(envelopeQName.getNamespaceURI(),
                envelopeQName.getPrefix() + ":" + envelopeQName.getLocalPart());
        root.appendChild(docEl);
View Full Code Here

Examples of org.w3c.dom.Document.adoptNode()

       
        doc.getDocumentElement().removeChild(samlElement);
        Element actualBody = getActualBody(doc.getDocumentElement());
        if (actualBody != null) {
            Document newDoc = DOMUtils.createDocument();
            newDoc.adoptNode(actualBody);
            message.setContent(XMLStreamReader.class,
                    new W3CDOMStreamReader(actualBody));
            message.setContent(InputStream.class, null);
        }
       
View Full Code Here

Examples of org.w3c.dom.Document.adoptNode()

    marshaller.marshal( rSAKeyPair, rSAKeyPairDoc );

    Document envelopedDoc = db.newDocument();
    Element unencryptedElement = envelopedDoc.createElement("PrivateKey");
    envelopedDoc.appendChild(unencryptedElement);
    Element node = (Element) envelopedDoc.adoptNode(rSAKeyPairDoc.getDocumentElement());
    unencryptedElement.appendChild(node);
   
        Element rootElement = envelopedDoc.getDocumentElement();
      
       
View Full Code Here

Examples of org.w3c.dom.Document.adoptNode()

                signedEl.removeAttribute("ID");
                root.removeChild(signatureElement);
            } else {
                Element actualBody = getActualBody(root);
                Document newDoc = DOMUtils.createDocument();
                newDoc.adoptNode(actualBody);
                root = actualBody;
            }
        }
        message.setContent(XMLStreamReader.class,
                           new W3CDOMStreamReader(root));
View Full Code Here

Examples of org.w3c.dom.Document.adoptNode()

                                                    String referenceId,
                                                    String sigAlgo) throws Exception {
        Element docEl = doc.getDocumentElement();
        Document newDoc = DOMUtils.createDocument();
        doc.removeChild(docEl);
        newDoc.adoptNode(docEl);
        Element object = newDoc.createElementNS(Constants.SignatureSpecNS, "ds:Object");
        object.appendChild(docEl);
        docEl.setAttributeNS(null, "ID", id);
        docEl.setIdAttributeNS(null, "ID", true)
       
View Full Code Here

Examples of org.w3c.dom.Document.adoptNode()

            String referenceId,
            String sigAlgo) throws Exception {
        Element docEl = doc.getDocumentElement();
        Document newDoc = DOMUtils.createDocument();
        doc.removeChild(docEl);
        newDoc.adoptNode(docEl);
        docEl.setAttributeNS(null, "ID", id);
        docEl.setIdAttributeNS(null, "ID", true)
       
        Element root = newDoc.createElementNS(envelopeQName.getNamespaceURI(),
                envelopeQName.getPrefix() + ":" + envelopeQName.getLocalPart());
View Full Code Here

Examples of org.w3c.dom.Document.adoptNode()

            NodeList nodeList = securedDocument.getElementsByTagNameNS(WSSConstants.TAG_wsu_Timestamp.getNamespaceURI(), WSSConstants.TAG_wsu_Timestamp.getLocalPart());
            Assert.assertEquals(nodeList.item(0).getParentNode().getLocalName(), WSSConstants.TAG_wsse_Security.getLocalPart());

            Node parentNode = nodeList.item(0).getParentNode();
            Node node = nodeList.item(0).cloneNode(true);
            securedDocument.adoptNode(node);
            parentNode.appendChild(node);

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

Examples of org.w3c.dom.Document.adoptNode()

      root.appendChild(doc.getDocumentElement());
      Element cajoledOutput = null;
      if (null != cajoledCache) {
        cajoledOutput = cajoledCache.getElement(key);
        if (null != cajoledOutput) {
          createContainerFor(doc, doc.adoptNode(cajoledOutput));
          content.documentChanged();
          HtmlSerialization.attach(doc, new CajaHtmlSerializer(), null);
          return;
        }
      }
View Full Code Here

Examples of org.w3c.dom.Document.adoptNode()

        cajoledOutput = doc.createElement("div");
        cajoledOutput.setAttribute("id", "cajoled-output");
        cajoledOutput.setAttribute("classes", "g___");
        cajoledOutput.setAttribute("style", "position: relative;");
       
        cajoledOutput.appendChild(doc.adoptNode(html));
        cajoledOutput.appendChild(tameCajaClientApi(doc));
        cajoledOutput.appendChild(doc.adoptNode(script));
       
        if (cajoledCache != null) {
          cajoledCache.addElement(key, cajoledOutput);
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.