Example usage for org.dom4j.io OutputFormat isTrimText

List of usage examples for org.dom4j.io OutputFormat isTrimText

Introduction

In this page you can find the example usage for org.dom4j.io OutputFormat isTrimText.

Prototype

public boolean isTrimText() 

Source Link

Usage

From source file:org.withinsea.izayoi.cortile.template.html.parser.HTMLWriter.java

License:Mozilla Public License

@Override
protected void writeElement(Element element) throws IOException {

    if (!HTMLConstants.ANONYMOUS_TAG_NAME.equals(element.getName())) {
        super.writeElement(element);
        return;//  www  .j  av a  2s. co  m
    }

    OutputFormat currentFormat = getOutputFormat();
    boolean saveTrimText = currentFormat.isTrimText();
    String currentIndent = currentFormat.getIndent();
    currentFormat.setNewlines(false);
    currentFormat.setTrimText(false);
    currentFormat.setIndent("");

    writePrintln();
    indent();
    writeElementContent(element);
    writePrintln();
    indent();

    currentFormat.setTrimText(saveTrimText);
    currentFormat.setIndent(currentIndent);
}