org.jdom2.CDATA Java Examples

The following examples show how to use org.jdom2.CDATA. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: TestLang.java    From Digital with GNU General Public License v3.0 5 votes vote down vote up
private Element addTextTo(Element el, String text) {
    if (text.contains("<html>"))
        el.addContent(new CDATA(text));
    else
        el.setText(text);
    return el;
}
 
Example #2
Source File: ContentModuleGenerator.java    From rome with Apache License 2.0 5 votes vote down vote up
protected Element generateCDATAElement(final String name, final String value) {
    final Element element = new Element(name, CONTENT_NS);
    final CDATA cdata = new CDATA(value);
    element.addContent(cdata);

    return element;
}
 
Example #3
Source File: JDOMUtil.java    From emissary with Apache License 2.0 4 votes vote down vote up
/**
 * Create a JDOM element with some CDATA
 */
public static Element cdataElement(final String name, final String text) {
    final Element e = new Element(name);
    e.addContent(new CDATA(text));
    return e;
}
 
Example #4
Source File: XmlBuilder.java    From iaf with Apache License 2.0 4 votes vote down vote up
public void setCdataValue(String value) {
	if (value != null) {
		element.setContent(new CDATA(value));
	}
}