Nav

Xml prettyprinter transformer

Formats an XML string using the Pretty Printer functionality in org.dom4j.io.OutputFormat.

Attributes of <xml-prettyprinter-transformer…​>

Name Type Required Default Description

expandEmptyElements

boolean

no

Whether to expand empty elements from <tagName> to <tagName></tagName>.

indentEnabled

boolean

no

Whether to enable indenting of the XML code. If true, the indent string and size are used.

indentString

string

no

The string to use as the indent, usually an empty space.

indentSize

integer

no

The number of indent strings to use for each indent, such as "2" if indentString is set to an empty space and you want to use two empty spaces for each indent.

lineSeparator

string

no

The string to use for new lines, typically "\n".

newLineAfterNTags

integer

no

If the newlines attribute is true, the number of closing tags after which a newline separator is inserted. For example, setting this to "5" will cause a newline to be inserted after the output of five closing tags (including single tags).

newlines

boolean

no

Whether newlines should be printed. If false, the XML is printed all on one line.

newLineAfterDeclaration

boolean

no

Whether a new line is printed after the XML declaration (assuming it is not supressed).

omitEncoding

boolean

no

Whether the XML declaration line includes the encoding of the document. It is common to suppress this in protocols such as SOAP.

padText

boolean

no

Whether to ensure that text immediately preceded by or followed by an element will be "padded" with a single space. This is useful when you set trimText to true and want to ensure that "the quick <b>brown</b> fox" does not become "the quick<b>brown</b>fox".

suppressDeclaration

boolean

no

Whether to suppress the XML declaration line. It is common to suppress this in protocols such as SOAP.

trimText

boolean

no

Whether to trim white space in the XML.

XHTML

boolean

no

Whether to use the XHTML standard, which is like HTML but passes an XML parser with real closed tags, and outputs CDATA sections with CDATA delimiters.

Child Elements of <xml-prettyprinter-transformer…​>

Name Cardinality Description