Package org.w3c.dom

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


       
        // Convert the Node elements to an XML DOM representation
        Document tempDocument = new DocumentImpl();
        Element tempRootElement = tempDocument.createElement("GISToolkit");     // Create Root Element
        addNode(tempDocument, tempRootElement, tempRootNode);
        tempDocument.appendChild(tempRootElement);
       
        // write the XML Document
        File tempFile = new File(inFileName);
        OutputFormat    format  = new OutputFormat( tempDocument );   //Serialize DOM
        format.setIndenting(true);
View Full Code Here


      } else if (event.getResolve().equals(ResolveType.CHILDREN)) {
        // NIT: wrap in event name element for now
        Document doc = builder.newDocument();
        Element parent = doc.createElement(event.getEventName());

        doc.appendChild(parent);

        for (Element elem : event.getResponses()) {
          parent.appendChild(doc.importNode(elem, true));
        }
View Full Code Here

         doc = builder.newDocument();

         Node elem = doc.createElement("ack");

         doc.appendChild(elem);
      } catch (ParserConfigurationException e) {
      } catch (FactoryConfigurationError e) {
      }

      return doc.getDocumentElement();
View Full Code Here

        try {
            OutputStream out = outputContext.getOutputStream();
            if (out != null && exists()) {
                if (isMultiple()) {
                    Document doc = DomUtil.BUILDER_FACTORY.newDocumentBuilder().newDocument();
                    doc.appendChild(getProperty(JCR_VALUES).toXml(doc));
                    OutputFormat format = new OutputFormat("xml", "UTF-8", false);
                    XMLSerializer serializer = new XMLSerializer(out, format);
                    serializer.setNamespaces(true);
                    serializer.asDOMSerializer().serialize(doc);
                } else {
View Full Code Here

  }
  // create new w3c DOM
  Document doc = docbldr.newDocument()
        org.w3c.dom.Node topElementNode =
            doc.appendChild(doc.createElementNS("", "__top__"));

        // Copy all the nodes in the nodelist to be under the top element
        copyNodes(nodeList, doc, topElementNode);
       
  // w3c DOM -> DOM2SAX -> DOMBuilder -> DOMImpl
View Full Code Here

        Element elem2 = doc.createElementNS("http://example.net", "etsi:elem2");
        Element stuff = doc.createElementNS("foo:bar", "dsig:stuff");
        elem2.appendChild(stuff);
        test.appendChild(elem2);
        local.appendChild(test);
        doc.appendChild(local);

        Node root = doc.getElementsByTagNameNS("http://example.net", "elem2").item(0);
        Canonicalizer20010315Excl c = new Canonicalizer20010315ExclWithComments();
        byte[] reference =
            JavaUtils.getBytesFromFile(getAbsolutePath(
View Full Code Here

            fail("Should raise a NullPointerException");
        } catch (NullPointerException npe) {}

        Document doc = XMLUtils.createDocumentBuilder(false).newDocument();
        Element elem = doc.createElementNS("http://acme.org", "parent");
        doc.appendChild(elem);
        DOMStructure parent = new DOMStructure(elem);
        try {
            ki.marshal(parent, null);
        } catch (Exception e) {
            fail("Should not throw an exception: " + e);
View Full Code Here

            "VGhlIFVSSSBvZiB0aGUgdHJhbnNmb3JtIGlzIGh0dHA6Ly93d3cudzMub3JnLzIwMDAvMDkveG1s\n"
            + "ZHNpZyNiYXNlNjQ=";

        Document doc = TransformBase64DecodeTest.createDocument();
        Transforms t = new Transforms(doc);
        doc.appendChild(t.getElement());
        t.addTransform(TransformBase64Decode.implementedTransformURI);

        XMLSignatureInput in =
            new XMLSignatureInput(new ByteArrayInputStream(s1.getBytes()));
        XMLSignatureInput out = t.performTransforms(in);
View Full Code Here

        String s2 =
            "VkdobElGVlNTU0J2WmlCMGFHVWdkSEpoYm5ObWIzSnRJR2x6SUdoMGRIQTZMeTkzZDNjdWR6TXVi\n"
            + "M0puTHpJd01EQXZNRGt2ZUcxcwpaSE5wWnlOaVlYTmxOalE9";
        Document doc = TransformBase64DecodeTest.createDocument();
        Transforms t = new Transforms(doc);
        doc.appendChild(t.getElement());

        t.addTransform(TransformBase64Decode.implementedTransformURI);

        XMLSignatureInput in =
            new XMLSignatureInput(new ByteArrayInputStream(s2.getBytes()));
View Full Code Here

        XMLSignatureInput xmlinput = new XMLSignatureInput(base64Node);

        Document doc2 = TransformBase64DecodeTest.createDocument();
        Transforms t = new Transforms(doc2);
        doc2.appendChild(t.getElement());
        t.addTransform(Transforms.TRANSFORM_BASE64_DECODE);

        XMLSignatureInput out = t.performTransforms(xmlinput);
        String result = new String(out.getBytes());
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.