Packages

c

scala.xml

PrettyPrinter

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

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. PrettyPrinter
  2. AnyRef
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new PrettyPrinter(width: Int, step: Int)

    width

    the width to fit the output into

    step

    indentation

Type Members

  1. case class Box(col: Int, s: String) extends Item with Product with Serializable
  2. class BrokenException extends java.lang.Exception
  3. class Item extends AnyRef
  4. case class Para(s: String) extends Item with Product with Serializable

Value Members

  1. 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

  2. def format(n: Node, pscope: NamespaceBinding, sb: StringBuilder): Unit
  3. 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

  4. 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

  5. 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

  6. object Break extends Item with Product with Serializable