Package org.w3c.dom

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


      WfProcess process
    = pmgr.createProcess(new DefaultRequester (workflowService));
      chan = workflowService.getChannel(process, "test_channel");
      DocumentBuilderFactory df = DocumentBuilderFactory.newInstance ();
      Document doc = df.newDocumentBuilder ().newDocument ();
      DocumentFragment frag = doc.createDocumentFragment ();
      frag.appendChild(doc.createElement ("root"));
            TransformerFactory tf = TransformerFactory.newInstance();
            Transformer t = tf.newTransformer ();
            SAXEventBufferImpl b = new SAXEventBufferImpl ();
            t.transform (new DOMSource (frag), new SAXResult(b));
View Full Code Here


    }

    private SAXEventBuffer convertToSax(List nodes)
        throws TransformerException {
        Document doc = W3CDomUtil.createNewDocument();
        DocumentFragment frag = doc.createDocumentFragment();
        for (Iterator i = nodes.iterator(); i.hasNext();) {
            Element e = (Element) i.next();
            frag.appendChild(doc.importNode(e, true));
        }
        return convertToSax(frag);
View Full Code Here

    public Node getBindings() {
        if (binds == null) {
            try {
                Document doc = DocumentBuilderFactory.newInstance()
                    .newDocumentBuilder().newDocument();
                binds = doc.createDocumentFragment();
                for (int i = 0; i < formalParameters.length; i++) {
                    FormalParameter fp = formalParameters[i];
                    Element binding
                        = doc.createElementNS(XMLUtil.XMLNS_XFORMS, "bind");
                    binding.setAttribute("id", applicationId + ":" + fp.id());
View Full Code Here

          }
        }
      };
      String key = HashUtil.rawChecksum(content.getContent().getBytes());
      Document doc = content.getDocument();
      Node root = doc.createDocumentFragment();
      root.appendChild(doc.getDocumentElement());
      Element cajoledOutput = null;
      if (null != cajoledCache) {
        cajoledOutput = cajoledCache.getElement(key);
        if (null != cajoledOutput) {
View Full Code Here

      DocumentBuilderFactory dbf = FactoryImpl.getDOMFactory(super.useServicesMechnism());
      dbf.setNamespaceAware(true);

      DocumentBuilder db = dbf.newDocumentBuilder();
      Document doc = db.newDocument();
      Node df = doc.createDocumentFragment();

      return getDTM(new DOMSource(df), true, null, false, false);
    }
    catch (Exception e)
    {
View Full Code Here

                contextDocument = ctx.getOwnerDocument();
            }

            Element fragElt =
                    (Element) contextDocument.importNode(d.getDocumentElement(), true);
            DocumentFragment result = contextDocument.createDocumentFragment();
            Node child = fragElt.getFirstChild();
            while (child != null) {
                fragElt.removeChild(child);
                result.appendChild(child);
                child = fragElt.getFirstChild();
View Full Code Here

      // This no longer will work right since the DTM.
      // Document myDoc = myProcessor.getContextNode().getOwnerDocument();
      Document myDoc = getDocument();

        Text textNode = myDoc.createTextNode(textNodeValue);
        DocumentFragment docFrag = myDoc.createDocumentFragment();

        docFrag.appendChild(textNode);

      return new NodeSet(docFrag);
    }
View Full Code Here

                docBuilder.setEntityResolver(entityResolver);

              Node xmlDoc = docBuilder.parse(new InputSource(inFileName));
              Document doc = docBuilder.newDocument();
              org.w3c.dom.DocumentFragment outNode =
                doc.createDocumentFragment();

              transformer.transform(new DOMSource(xmlDoc, inFileName),
                                    new DOMResult(outNode));

              // Now serialize output to disk with identity transformer
View Full Code Here

                docBuilder.setEntityResolver(entityResolver);

              Node xmlDoc = docBuilder.parse(new InputSource(inFileName));
              Document doc = docBuilder.newDocument();
              org.w3c.dom.DocumentFragment outNode =
                doc.createDocumentFragment();

              transformer.transform(new DOMSource(xmlDoc, inFileName),
                                    new DOMResult(outNode));

              // Now serialize output to disk with identity transformer
View Full Code Here

                        sl.setName(getText(e));
                        sl.setVersion(getAttribute(e, VERSION));
                        sls.add(sl);
                    } else {
                        if (ext == null) {
                            ext = doc.createDocumentFragment();
                        }
                        ext.appendChild(e);
                    }
                }
                component.setSharedLibraries(sls.toArray(new SharedLibraryList[sls.size()]));
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.