Package org.w3c.dom

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


            temporaryDocument = DocumentUtil.createDocument();
        } catch (ConfigurationException e) {
            throw new ProcessingException(e);
        }

        temporaryDocument.adoptNode(clonedAssertionElement);
        temporaryDocument.appendChild(clonedAssertionElement);

        signDocument(temporaryDocument);

        samlDocument.adoptNode(clonedAssertionElement);
View Full Code Here


    Node cajoledData = null;
    if (cajoledCache != null && !debug) {
      Element cajoledOutput = cajoledCache.getElement(cacheKey);
      if (cajoledOutput != null) {
        cajoledData = doc.adoptNode(cajoledOutput);
        createContainerFor(doc, cajoledData);
        mc.documentChanged();
      }
    }
View Full Code Here

        Element 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));

        Element messagesNode = formatErrors(doc, is, docContent, mq,
            /* is invisible */ false);
View Full Code Here

        cajoledOutput.setAttribute("classes", "g___");
        cajoledOutput.setAttribute("style", "position: relative;");

        cajoledOutput.appendChild(doc.adoptNode(html));
        cajoledOutput.appendChild(tameCajaClientApi(doc));
        cajoledOutput.appendChild(doc.adoptNode(script));

        Element messagesNode = formatErrors(doc, is, docContent, mq,
            /* is invisible */ false);
        cajoledOutput.appendChild(messagesNode);
        if (cajoledCache != null && !debug) {
View Full Code Here

                    temporaryDocument = DocumentUtil.createDocument();
                } catch (ConfigurationException e) {
                    throw this.logger.processingError(e);
                }

                temporaryDocument.adoptNode(clonedAssertionElement);
                temporaryDocument.appendChild(clonedAssertionElement);

                logger.trace("Going to sign assertion within response document.");
                signDocument(temporaryDocument, keypair, x509Certificate);
View Full Code Here

       
        Element assertionEl = assertion.toDOM(newDoc);
        root.appendChild(assertionEl);
       
        payloadDoc.removeChild(docEl);
        newDoc.adoptNode(docEl);
        root.appendChild(docEl);

        if (signLater) {
            // It appears adopting and removing nodes
            // leaves some stale refs/state with adopted nodes and thus the digest ends up
View Full Code Here

            Document prev = otherNode.getOwnerDocument();
            Document doc = thisNode.getOwnerDocument();
            clearXpathContext(prev);
            clearXpathContext(doc);
            if (doc != null && doc != otherNode.getOwnerDocument()) {
                Node ret = doc.adoptNode(otherNode);
                // FIXME: this is really a hack, see documentation of fixUserData() for more details.
                fixUserData(prev, ret);
                if (ret == null) {
                    throw context.getRuntime().newRuntimeError("Failed to take ownership of node");
                }
View Full Code Here

        Document doc = Utils.getBuilder().newDocument();
        Element retval = doc.createElementNS(elemName, elemNamespace);
        for (DataProvider source : getSources()) {
            Element child = source.getRootElement(request);
            if (child != null) {
                retval.appendChild(doc.adoptNode(child));
            }
        }
        return retval;
    }
View Full Code Here

        "<!DOCTYPE html>"
    };
    for (String docType : docTypes) {
      Document doc = DomParser.makeDocument(DoctypeMaker.parse(docType), null);
      Element el = html(fromString("<html><b>my text</b></html>"));
      doc.appendChild(doc.adoptNode(el));
      MoreAsserts.assertStartsWith(docType,
          Nodes.render(doc.getDoctype(), el, null));
    }
  }
View Full Code Here

    for (String docType : docTypes) {
      for (Pair<MarkupRenderMode, String> expectedPair : expectedPairs) {
        Document doc = DomParser.makeDocument(
            DoctypeMaker.parse(docType), null);
        Element el = html(fromString("<html><b>my text</b></html>"));
        doc.appendChild(doc.adoptNode(el));

        StringBuilder sb = new StringBuilder();
        RenderContext rc = new RenderContext(new Concatenator(sb))
        .withMarkupRenderMode(expectedPair.a);
        Nodes.render(doc.getDoctype(), el, Namespaces.HTML_DEFAULT, rc);
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.