Example usage for org.jdom2 Text getValue

List of usage examples for org.jdom2 Text getValue

Introduction

In this page you can find the example usage for org.jdom2 Text getValue.

Prototype

@Override
public String getValue() 

Source Link

Document

Returns the XPath 1.0 string value of this element, which is the text itself.

Usage

From source file:org.buddycloud.channelserver.XMPPAcceptanceTestHelper.java

License:Apache License

protected String getText(Packet p, String xPath) throws Exception {
    Text evaluateFirst = (Text) getEl(p, xPath);
    return evaluateFirst == null ? null : evaluateFirst.getValue();
}

From source file:org.isisaddons.module.docx.dom.util.Jdom2.java

License:Apache License

public static String textValueOf(Element htmlElement) {
    List<Content> htmlContent = htmlElement.getContent();
    if (htmlContent.isEmpty()) {
        return null;
    }//from w w  w  . ja va2 s . co m
    Content content = htmlContent.get(0);
    if (!(content instanceof Text)) {
        return null;
    }
    Text htmlText = (Text) content;
    return normalized(htmlText.getValue());
}