Example usage for org.jdom2.output XMLOutputter outputElementContent

List of usage examples for org.jdom2.output XMLOutputter outputElementContent

Introduction

In this page you can find the example usage for org.jdom2.output XMLOutputter outputElementContent.

Prototype

public final void outputElementContent(Element element, Writer out) throws IOException 

Source Link

Document

This will handle printing out an Element 's content only, not including its tag, and attributes.

Usage

From source file:AIR.Common.xml.XmlElement.java

License:Open Source License

public String getInnerXml() {
    XMLOutputter outp = new XMLOutputter();

    outp.setFormat(Format.getCompactFormat());
    try (StringWriter sw = new StringWriter()) {
        if (_element instanceof Element)
            outp.outputElementContent((Element) _element, sw);
        else {//from   w  w w  .j ava 2 s  .  co m
            // TODO: What to do for other types of Content?
        }

        return sw.toString();
    } catch (IOException e1) {
        e1.printStackTrace();
        throw new XmlReaderException(e1);
    }
}