Here you can find the source of createText(String sValue, Node nParent)
Parameter | Description |
---|---|
sValue | The value for the new textnode. |
nParent | The parent node. |
public static void createText(String sValue, Node nParent)
//package com.java2s; //License from project: Apache License import org.w3c.dom.Document; import org.w3c.dom.Node; public class Main { /**/*from w w w.j a va2 s .c o m*/ * This method creates a new textnode with the passed on value. * * @param sValue The value for the new textnode. * @param nParent The parent node. */ public static void createText(String sValue, Node nParent) { if (nParent != null) { Document dDoc = nParent.getOwnerDocument(); Node nTemp = dDoc.createTextNode(sValue); nParent.appendChild(nTemp); } } }