Java XML Text Node Create createTextNode(Node node, String data)

Here you can find the source of createTextNode(Node node, String data)

Description

create Text Node

License

Apache License

Declaration

public static Text createTextNode(Node node, String data) 

Method Source Code

//package com.java2s;
/**//from w w w.  j ava  2  s .c  o  m
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements. See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership. The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License. You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing,
 * software distributed under the License is distributed on an
 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 * KIND, either express or implied. See the License for the
 * specific language governing permissions and limitations
 * under the License.
 */

import org.w3c.dom.Document;

import org.w3c.dom.Node;
import org.w3c.dom.Text;

public class Main {
    public static Text createTextNode(Document root, String data) {
        return root.createTextNode(data);
    }

    public static Text createTextNode(Node node, String data) {
        return createTextNode(node.getOwnerDocument(), data);
    }
}

Related

  1. createTextNode(Document doc, Calendar cal, boolean dateOnly)
  2. createTextNode(Document doc, String elemName, String attrName, String attrValue, String content)
  3. createTextNode(Document doc, String string)
  4. createTextNode(Element element, String nodeName, String textValue)
  5. createTextNode(Node doc, String elementName, String elementText)
  6. extractOrCreateTextNode(Element filenameElement, String defaultText)
  7. getFirstNodeFromPath(Node contextNode, final String[] path, final boolean create)