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.
- Note
This class is not threadsafe and should not be accessed by multiple threads at the same time.
- Alphabetic
- By Inheritance
- PrettyPrinter
- AnyRef
- Any
- Hide All
- Show All
- Public
- All
Instance Constructors
Type Members
- case class Box(col: Int, s: String) extends Item with Product with Serializable
- class BrokenException extends java.lang.Exception
- class Item extends AnyRef
- case class Para(s: String) extends Item with Product with Serializable
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: collection.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: collection.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
- val minimizeMode: MinimizeMode.Value
- object Break extends Item with Product with Serializable