List of utility methods to do XML Text Node Create
Text | createText(Document doc, Node parent, String contents) Creates a text node in the specified document. Text result = doc.createTextNode(contents); if (parent != null) parent.appendChild(result); return result; |
String | createText(DocumentFragment fragment) Create a string from a DOM document fragment. StringBuffer value = new StringBuffer(); if (fragment != null) { NodeList childs = fragment.getChildNodes(); if (childs != null) { Node current; for (int i = 0; i < childs.getLength(); i++) { current = childs.item(i); if (current.getNodeType() == Node.TEXT_NODE) { ... |
void | createTextChildElement(Document doc, Node node, String name, String value) create Text Child Element Element element = createChildElement(doc, node, name); element.appendChild(doc.createTextNode(value)); |
Element | createTextElement(Document d, String textElementName, String textElementValue) create Text Element Element placeName = d.createElement(textElementName); Element placeNameText = d.createElement("text"); placeNameText.setTextContent(textElementValue); placeName.appendChild(placeNameText); return placeName; |
Element | createTextElement(Document doc, String elementName, String value) create Text Element Element element = doc.createElement(elementName);
Text text = doc.createTextNode(value);
element.appendChild(text);
return element;
|
Node | createTextElement(Document doc, String name, String content) create Text Element Node elementNode = doc.createElement(name);
Node textNode = doc.createTextNode(content);
elementNode.appendChild(textNode);
return elementNode;
|
Element | createTextElement(final Document document, final String tagName, final String text) Creates an Element containing the given text final Element element = document.createElement(tagName); element.setTextContent(text); return element; |
Element | createTextElement(QName qname, String value, Document doc) create Text Element Element element = doc.createElementNS(qname.getNamespaceURI(), qname.getLocalPart());
element.setTextContent(value);
return element;
|
Text | createTextLn(Document d, String text) Creates a text node in an XML document ended by a new line character return createText(d, text + "\n"); |
Node | createTextNode(Document _doc, String tagName, String tagValue) Create TextNode. Element tag = _doc.createElement(tagName);
Text tagText = _doc.createTextNode(tagValue);
tag.appendChild(tagText);
return tag;
|