protected Node createCData (Token token) { return new Text (token); }
protected Node createText (Token token) { return new Text (token); }
protected Node createElementWhitespace (Token token) { return new Text (token); }
/** * Adds the given text to the given node */ public static Text addText(Element element, String text) { Text textNode = new Text(text + " "); element.addNode(textNode); return textNode; }
/** * Adds the given text to the given node */ public static Text addText(Element element, String text) { Text textNode = new Text(text + " "); element.addNode(textNode); return textNode; }
@Override public Text createClone () { return new Text (getType (), null); }
public Element setText (String text) { clearText (); addNode (0, new Text (text)); return this; }
/** * Creates a new child of the given element adding the text after the new node */ public static Element createChild(Element element, String name, String text) { if (text != null) { element.addNode(new Text(text + " ")); } Element child = new Element(name); element.addNode(child); if (text != null) { element.addNode(new Text(text)); } return child; }
/** * Creates a new child of the given element adding the text after the new node */ public static Element createChild(Element element, String name, String text) { if (text != null) { element.addNode(new Text(text + " ")); } Element child = new Element(name); element.addNode(child); if (text != null) { element.addNode(new Text(text)); } return child; }
protected XMLDeclaration createXMLDeclaration () { if (xmlDeclaration == null) { addNode (0, new XMLDeclaration ("1.0")); addNode (1, new Text ("\n")); } return xmlDeclaration; }
/** * Returns the first child with the given name, lazily creating one if required with the * given text prepended before the element if the text is not null */ public static Element getOrCreateChild(Element element, String name, String text) { Element child = firstChild(element, name); if (child == null) { if (text != null) { element.addNode(new Text(text + " ")); } child = new Element(name); element.addNode(child); if (text != null) { element.addNode(new Text(text + " ")); } } return child; }
/** * Returns the first child with the given name, lazily creating one if required with the * given text prepended before the element if the text is not null */ public static Element getOrCreateChild(Element element, String name, String text) { Element child = firstChild(element, name); if (child == null) { if (text != null) { element.addNode(new Text(text + " ")); } child = new Element(name); element.addNode(child); if (text != null) { element.addNode(new Text(text + " ")); } } return child; }
text = "\n" + text; descr.addNode(new Text(text));
text = "\n" + text; descr.addNode(new Text(text));
parent.addNode (new Text (expandedEntity)); return;