Examples of createDocumentFragment()


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

        if (path.startsWith("/") == true) path = path.substring(1);
        NodeList list = null;

        if (path == null || path.equals("") == true) {
            Document doc = XMLUtil.createDocument();
            result = doc.createDocumentFragment();
            this.getLayoutDOM();
            if (this.layoutDOM != null) {
                result.appendChild(doc.importNode(this.layoutDOM.getDocumentElement(), true));
            }
            if (this.configurationDOM != null) {
View Full Code Here

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

            }
        }

        if (list != null && list.getLength() > 0) {
            Document doc = XMLUtil.createDocument();
            result = doc.createDocumentFragment();

            for(int i = 0; i < list.getLength(); i++) {

                // the found node is either an attribute or an element
                if (list.item(i).getNodeType() == Node.ATTRIBUTE_NODE) {
View Full Code Here

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

            break;
        case Node.COMMENT_NODE:
            copy = doc.createComment(((Comment) child).getData());
            break;
        case Node.DOCUMENT_FRAGMENT_NODE:
            copy = doc.createDocumentFragment();
            break;
        case Node.ELEMENT_NODE:
            final Element elem = doc.createElement(((Element) child).getTagName());
            copy = elem;
            final NamedNodeMap attributes = child.getAttributes();
View Full Code Here

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

    // Create a mock tag;  the name doesn't truly matter
    Element tag = doc.createElement("test");
    tag.setAttribute("code", "${code}");
    processor.expressionResults = ImmutableMap.of(
        "${code}", "Hello <b>World</b>!");
    DocumentFragment fragment = doc.createDocumentFragment();
    handler.process(fragment, tag, processor);
    assertEquals(3, fragment.getChildNodes().getLength());
    assertEquals("b", fragment.getChildNodes().item(1).getNodeName());
  }
}
View Full Code Here

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

        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document myDoc = db.newDocument();
       
        Text textNode = myDoc.createTextNode(textNodeValue);
        DocumentFragment docFrag = myDoc.createDocumentFragment();
 
        docFrag.appendChild(textNode);
 
        return new NodeSet(docFrag);
      }
View Full Code Here

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

        if(defaultRootElementName != null) {
            Node rootNode = document.createElementNS(namespaceURI, defaultRootElementName);
            document.appendChild(rootNode);
            return document.getDocumentElement();
        } else {
            DocumentFragment fragment = document.createDocumentFragment();
            return fragment;
        }
    }

    /**
 
View Full Code Here

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

                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

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

      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

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

        DocumentBuilderFactory dbf = DocumentBuilderFactory.newInstance();
        DocumentBuilder db = dbf.newDocumentBuilder();
        Document myDoc = db.newDocument();
       
        Text textNode = myDoc.createTextNode(textNodeValue);
        DocumentFragment docFrag = myDoc.createDocumentFragment();
 
        docFrag.appendChild(textNode);
 
        return new NodeSet(docFrag);
      }
View Full Code Here

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

    {
      // use a version explicitly with ISO-8859-1 instead
      byte[] markupBytes = markUp.getBytes();
      Document newDoc = builder.parse(new ByteArrayInputStream(markupBytes));
   
      DocumentFragment fragment = newDoc.createDocumentFragment();
     
      // add the document's root element to the fragment
      fragment.appendChild(newDoc.getDocumentElement());
     
      return fragment;
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.