Java XML Text Node Create createTextElement(Document d, String textElementName, String textElementValue)

Here you can find the source of createTextElement(Document d, String textElementName, String textElementValue)

Description

create Text Element

License

Open Source License

Declaration

protected static Element createTextElement(Document d, String textElementName, String textElementValue) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import org.w3c.dom.Document;
import org.w3c.dom.Element;

public class Main {
    protected static Element createTextElement(Document d, String textElementName, String textElementValue) {
        Element placeName = d.createElement(textElementName);
        Element placeNameText = d.createElement("text");
        placeNameText.setTextContent(textElementValue);
        placeName.appendChild(placeNameText);
        return placeName;
    }/*from  w w  w.jav  a 2  s .  co m*/
}

Related

  1. appendElementChild(Document doc, Element parent, String name)
  2. appendElementChildWithText(Document doc, Element parent, String name, String text)
  3. createText(Document doc, Node parent, String contents)
  4. createText(DocumentFragment fragment)
  5. createTextChildElement(Document doc, Node node, String name, String value)
  6. createTextElement(Document doc, String elementName, String value)
  7. createTextElement(Document doc, String name, String content)
  8. createTextElement(final Document document, final String tagName, final String text)
  9. createTextElement(QName qname, String value, Document doc)