Example usage for com.liferay.portal.kernel.xml Element addText

List of usage examples for com.liferay.portal.kernel.xml Element addText

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.xml Element addText.

Prototype

public Element addText(String text);

Source Link

Usage

From source file:com.slemarchand.peoplepublisher.util.PeoplePublisherImpl.java

License:Open Source License

private String _getUserXml(String screenName) {

    String xml = null;// w  w w.j a v  a  2s. c  o  m

    try {
        Document document = SAXReaderUtil.createDocument(StringPool.UTF8);

        Element userElement = document.addElement("user");

        Element screenNameElement = userElement.addElement("screen-name");

        screenNameElement.addText(screenName);

        xml = document.formattedString(StringPool.BLANK);
    } catch (IOException ioe) {
        if (_log.isWarnEnabled()) {
            _log.warn(ioe);
        }
    }

    return xml;
}