PrettyPrinter
Class for pretty printing. After instantiating, you can use the format() and formatNode() methods to convert XML to a formatted string. The class can be reused to pretty print any number of XML nodes.
Class for pretty printing. After instantiating, you can use the format() and formatNode() methods to convert XML to a formatted string. The class can be reused to pretty print any number of XML nodes.
- Value Params
- minimizeEmpty
self-close empty tags
- step
indentation
- width
the width to fit the output into
- Authors
Burak Emir
- Note
This class is not threadsafe and should not be accessed by multiple threads at the same time.
Type members
Value members
Constructors
Concrete methods
Appends a formatted string containing well-formed XML with given namespace to prefix mapping to the given string buffer.
Appends a formatted string containing well-formed XML with given namespace to prefix mapping to the given string buffer.
- Value Params
- n
the node to be serialized
- sb
the stringbuffer to append to
Returns a formatted string containing well-formed XML with given namespace to prefix mapping.
Returns a formatted string containing well-formed XML with given namespace to prefix mapping.
- Value Params
- n
the node to be serialized
- pscope
the namespace to prefix mapping
- Returns
the formatted string
Returns a formatted string containing well-formed XML.
Returns a formatted string containing well-formed XML.
- Value Params
- nodes
the sequence of nodes to be serialized
- pscope
the namespace to prefix mapping
Appends a formatted string containing well-formed XML with the given namespace to prefix mapping to the given stringbuffer.
Appends a formatted string containing well-formed XML with the given namespace to prefix mapping to the given stringbuffer.
- Value Params
- nodes
the nodes to be serialized
- pscope
the namespace to prefix mapping
- sb
the string buffer to which to append to