Class XmlOutputFormat
java.lang.Object
org.dom4j.io.OutputFormat
au.com.acegi.xmlformat.XmlOutputFormat
- All Implemented Interfaces:
Cloneable
public class XmlOutputFormat
extends org.dom4j.io.OutputFormat
Extended DOM4J configuration.
- Defaults to pretty print.
- Adds an option to keep blank lines.
-
Field Summary
Fields inherited from class org.dom4j.io.OutputFormat
ALPHABETICALLY_ORDERED_ATTRIBUTES_COMPARATOR, STANDARD_INDENT -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanWhen set to true, preserves at most one blank line between tags, if it was alredy present in the input file.voidsetKeepBlankLines(boolean keepBlankLines) When set to true, preserves at most one blank line between tags, if it was alredy present in the input file.Methods inherited from class org.dom4j.io.OutputFormat
createCompactFormat, createPrettyPrint, getAttributeQuoteCharacter, getAttributesOrderComparator, getEncoding, getIndent, getLineSeparator, getNewLineAfterNTags, isExpandEmptyElements, isNewLineAfterDeclaration, isNewlines, isOmitEncoding, isPadText, isSuppressDeclaration, isTrimText, isXHTML, parseOptions, setAttributeQuoteCharacter, setAttributesOrderComparator, setEncoding, setExpandEmptyElements, setIndent, setIndent, setIndentSize, setLineSeparator, setNewLineAfterDeclaration, setNewLineAfterNTags, setNewlines, setOmitEncoding, setPadText, setSuppressDeclaration, setTrimText, setXHTML
-
Constructor Details
-
XmlOutputFormat
public XmlOutputFormat()Instantiates a new xml output format.
-
-
Method Details
-
isKeepBlankLines
public boolean isKeepBlankLines()When set to true, preserves at most one blank line between tags, if it was alredy present in the input file. Defaults tofalse.- Returns:
- Whether blank lines are preserved, or not.
-
setKeepBlankLines
public void setKeepBlankLines(boolean keepBlankLines) When set to true, preserves at most one blank line between tags, if it was alredy present in the input file.- Parameters:
keepBlankLines- true to preserve at most one blank line, false to remove all blank lines.
-