scala.xml

class PrettyPrinter

[source: scala/xml/PrettyPrinter.scala]

class PrettyPrinter(width : Int, step : Int)
extends AnyRef
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
Value Summary
protected var cur : Int
protected var items : List[Item]
Method Summary
protected def childrenAreLeaves (n : Node) : Boolean
protected def cut (s : String, ind : Int) : List[Item]
Try to cut at whitespace.
protected def endTag (n : Node) : String
protected def fits (test : String) : Boolean
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.
def format (n : Node, pscope : NamespaceBinding, sb : StringBuilder) : Unit
def format (n : Node) : String
returns a formatted string containing well-formed XML with default namespace prefix mapping
def format (n : Node, pscope : NamespaceBinding) : String
Returns a formatted string containing well-formed XML with given namespace to prefix mapping.
def formatNodes (nodes : Seq[Node], pscope : NamespaceBinding) : String
Returns a formatted string containing well-formed XML.
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.
def formatNodes (nodes : Seq[Node]) : String
Returns a formatted string containing well-formed XML nodes with default namespace prefix mapping.
protected def leafTag (n : Node) : String
protected def makeBox (ind : Int, s : String) : Unit
Try to make indented box, if possible, else para.
protected def makeBreak : Unit
protected def makePara (ind : Int, s : String) : Unit
protected def reset : Unit
protected def startTag (n : Node, pscope : NamespaceBinding) : (String, Int)
protected def traverse (node : Node, pscope : NamespaceBinding, ind : Int) : Unit
protected def traverse (it : Iterator[Node], scope : NamespaceBinding, ind : Int) : Unit
Methods inherited from AnyRef
getClass, hashCode, equals, clone, toString, notify, notifyAll, wait, wait, wait, finalize, ==, !=, eq, ne, synchronized
Methods inherited from Any
==, !=, isInstanceOf, asInstanceOf
Class Summary
case class Box (val col : Int, val s : String) extends Item with Product
class BrokenException extends Exception with AnyRef
class Item extends AnyRef
case class Para (val s : String) extends Item with Product
Object Summary
case object Break extends Item with Product