class PrettyPrinter extends AnyRef
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.
- Version
1.0
- Alphabetic
- By Inheritance
- PrettyPrinter
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
-
new
PrettyPrinter(width: Int, step: Int)
- width
the width to fit the output into
- step
indentation
Type Members
Value Members
-
def
format(n: Node, pscope: NamespaceBinding = TopScope): String
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.
- n
the node to be serialized
- pscope
the namespace to prefix mapping
- returns
the formatted string
- def format(n: Node, pscope: NamespaceBinding, sb: StringBuilder): Unit
-
def
format(n: Node, sb: StringBuilder): Unit
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.
- n
the node to be serialized
- sb
the stringbuffer to append to
-
def
formatNodes(nodes: Seq[Node], pscope: NamespaceBinding, sb: StringBuilder): Unit
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.
- nodes
the nodes to be serialized
- pscope
the namespace to prefix mapping
- sb
the string buffer to which to append to
-
def
formatNodes(nodes: Seq[Node], pscope: NamespaceBinding = TopScope): String
Returns a formatted string containing well-formed XML.
Returns a formatted string containing well-formed XML.
- nodes
the sequence of nodes to be serialized
- pscope
the namespace to prefix mapping
- object Break extends Item with Product with Serializable