in scala.xml
class PrettyPrinter

class PrettyPrinter
extends java.lang.Object
with scala.ScalaObject
Class for pretty printing. After instantiating, you can use the toPrettyXML methods to convert XML to a formatted string. The class can be reused to pretty print any number of XML nodes.
Author:
Burak Emir
Version:
1.0
Parameters:
width - the width to fit the output into @step indentation

Class Summary
case class Box

class BrokenException

class Item

case class Para



Object Summary
case object Break



Constructor Summary
def this (width: scala.Int, step: scala.Int)



Var Summary
protected var cur : scala.Int

protected var items : scala.List[PrettyPrinter.this.Item]



Def Summary
protected def childrenAreLeaves (n: scala.xml.Node) : scala.Boolean

protected def cut (s: java.lang.String, ind: scala.Int) : scala.List[PrettyPrinter.this.Item]
Try to cut at whitespace.
protected def endTag (n: scala.xml.Node) : java.lang.String

protected def fits (test: java.lang.String) : scala.Boolean

def format (n: scala.xml.Node) : java.lang.String
returns a formatted string containing well-formed XML with default namespace prefix mapping
def format (n: scala.xml.Node, pscope: scala.xml.NamespaceBinding) : java.lang.String
Returns a formatted string containing well-formed XML with given namespace to prefix mapping.
def format (n: scala.xml.Node, pscope: scala.xml.NamespaceBinding, sb: scala.compat.StringBuilder) : scala.Unit

def format (n: scala.xml.Node, sb: scala.compat.StringBuilder) : scala.Unit
Appends a formatted string containing well-formed XML with given namespace to prefix mapping to the given string buffer.
def formatNodes (nodes: scala.Seq[scala.xml.Node]) : java.lang.String
Returns a formatted string containing well-formed XML nodes with default namespace prefix mapping.
def formatNodes (nodes: scala.Seq[scala.xml.Node], pscope: scala.xml.NamespaceBinding) : java.lang.String
Returns a formatted string containing well-formed XML.
def formatNodes (nodes: scala.Seq[scala.xml.Node], pscope: scala.xml.NamespaceBinding, sb: scala.compat.StringBuilder) : scala.Unit
Appends a formatted string containing well-formed XML with the given namespace to prefix mapping to the given stringbuffer.
protected def leafTag (n: scala.xml.Node) : java.lang.String

protected def makeBox (ind: scala.Int, s: java.lang.String) : scala.Unit
Try to make indented box, if possible, else para.
protected def makeBreak : scala.Unit

protected def makePara (ind: scala.Int, s: java.lang.String) : scala.Unit

protected def reset : scala.Unit

protected def startTag (n: scala.xml.Node, pscope: scala.xml.NamespaceBinding) : scala.Tuple2[java.lang.String,scala.Int]

protected def traverse (it: scala.Iterator[scala.xml.Node], scope: scala.xml.NamespaceBinding, ind: scala.Int) : scala.Unit

protected def traverse (node: scala.xml.Node, pscope: scala.xml.NamespaceBinding, ind: scala.Int) : scala.Unit



Constructor Detail
def this (width: scala.Int, step: scala.Int)

Var Detail
protected var cur : scala.Int

protected var items : scala.List[PrettyPrinter.this.Item]

Def Detail
protected def childrenAreLeaves (n: scala.xml.Node): scala.Boolean

protected def cut (s: java.lang.String, ind: scala.Int): scala.List[PrettyPrinter.this.Item]
Try to cut at whitespace.
Parameters:
s - ...
Parameters:
ind - ...
Returns:
...

protected def endTag (n: scala.xml.Node): java.lang.String

protected def fits (test: java.lang.String): scala.Boolean

def format (n: scala.xml.Node): java.lang.String
returns a formatted string containing well-formed XML with default namespace prefix mapping
Parameters:
n - the node to be serialized
Returns:
...

def format (n: scala.xml.Node, pscope: scala.xml.NamespaceBinding): java.lang.String
Returns a formatted string containing well-formed XML with given namespace to prefix mapping.
Parameters:
n - the node to be serialized
Parameters:
pmap - the namespace to prefix mapping
Returns:
...

def format (n: scala.xml.Node, pscope: scala.xml.NamespaceBinding, sb: scala.compat.StringBuilder): scala.Unit

def format (n: scala.xml.Node, sb: scala.compat.StringBuilder): scala.Unit
Appends a formatted string containing well-formed XML with given namespace to prefix mapping to the given string buffer.
Parameters:
n - the node to be serialized
Parameters:
pmap - the namespace to prefix mapping
Parameters:
sb - the stringbuffer to append to

def formatNodes (nodes: scala.Seq[scala.xml.Node]): java.lang.String
Returns a formatted string containing well-formed XML nodes with default namespace prefix mapping.
Parameters:
nodes - ...
Returns:
...

def formatNodes (nodes: scala.Seq[scala.xml.Node], pscope: scala.xml.NamespaceBinding): java.lang.String
Returns a formatted string containing well-formed XML.
Parameters:
nodes - the sequence of nodes to be serialized
Parameters:
pmap - the namespace to prefix mapping

def formatNodes (nodes: scala.Seq[scala.xml.Node], pscope: scala.xml.NamespaceBinding, sb: scala.compat.StringBuilder): scala.Unit
Appends a formatted string containing well-formed XML with the given namespace to prefix mapping to the given stringbuffer.
Parameters:
n - the node to be serialized
Parameters:
pmap - the namespace to prefix mapping
Parameters:
sb - the string buffer to which to append to

protected def leafTag (n: scala.xml.Node): java.lang.String
Parameters:
n - ...
Returns:
...

protected def makeBox (ind: scala.Int, s: java.lang.String): scala.Unit
Try to make indented box, if possible, else para.
Parameters:
ind - ...
Parameters:
s - ...
Returns:
...

protected def makeBreak : scala.Unit

protected def makePara (ind: scala.Int, s: java.lang.String): scala.Unit

protected def reset : scala.Unit

protected def startTag (n: scala.xml.Node, pscope: scala.xml.NamespaceBinding): scala.Tuple2[java.lang.String,scala.Int]

protected def traverse (it: scala.Iterator[scala.xml.Node], scope: scala.xml.NamespaceBinding, ind: scala.Int): scala.Unit

protected def traverse (node: scala.xml.Node, pscope: scala.xml.NamespaceBinding, ind: scala.Int): scala.Unit
Parameters:
tail - : what we'd like to sqeeze in