set Text Content to XML Node - Java XML

Java examples for XML:DOM Node

Description

set Text Content to XML Node

Demo Code


//package com.java2s;

import org.w3c.dom.*;

public class Main {
    public static Document d;

    public static void setTextContent(Node n, String s) {
        n.appendChild(d.createTextNode(s));
    }//from ww  w .j a  v  a 2 s .  c om
}

Related Tutorials