Scala API

This document is the API specification for Scala Library

Class Summary
abstract class ConstructingHandler extends MarkupHandler
Implementation of MarkupHandler that constructs nodes.
class ConstructingParser (inp : Source, presWS : Boolean) extends ConstructingHandler with ExternalSources with MarkupParser
An xml parser. parses XML and invokes callback methods of a MarkupHandler. Don't forget to call on a freshly instantiated parser in order to initialize it. If you get the parser from the object method, initialization is already done for you.
object parseFromURL {
  def main(args:Array[String]): Unit = {
    val url = args(0);
    val src =;
    val cpa = scala.xml.parsing.ConstructingParser.fromSource(src, false); // fromSource initializes automatically
    val doc = cpa.document();
    // let's see what it is
    val ppr = new scala.xml.PrettyPrinter(80,5);
    val ele = doc.docElem;
    Console.println("finished parsing");
    val out = ppr.format(ele);
abstract class DefaultMarkupHandler extends MarkupHandler
default implemenation of markup handler always returns NodeSeq.Empty
trait ExternalSources extends AnyRef
abstract class FactoryAdapter extends org.xml.sax.helpers.DefaultHandler with AnyRef
SAX adapter class, for use with Java SAX parser. Keeps track of namespace bindings, without relying on namespace handling of the underlying SAX parser.
case class FatalError (val msg : java.lang.String) extends java.lang.RuntimeException with Product
abstract class MarkupHandler extends Logged
class that handles markup - provides callback methods to MarkupParser. the default is nonvalidating behaviour
trait MarkupParser extends TokenTests
An XML parser. Parses XML 1.0, invokes callback methods of a MarkupHandler and returns whatever the markup handler returns. Use ConstructingParser if you just want to parse XML to construct instances of scala.xml.Node. While XML elements are returned, DTD declarations - if handled - are collected using side-effects.
class NoBindingFactoryAdapter extends FactoryAdapter with NodeFactory[Elem]
nobinding adaptor providing callbacks to parser to create elements. implements hash-consing
trait PCDataMarkupParser [PCM <: MarkupParser with MarkupHandler] extends MarkupParser
Extends the Markup Parser to do the right thing (tm) with PCData blocks. (c) David Pollak, 2007 WorldWide Conferencing, LLC
trait TokenTests extends AnyRef
Helper functions for parsing XML fragments
abstract class ValidatingMarkupHandler extends MarkupHandler
class XhtmlParser (val input : Source) extends ConstructingHandler with PCDataMarkupParser[XhtmlParser] with ExternalSources
An XML Parser that preserves CDATA blocks and knows about HtmlEntities. (c) David Pollak, 2007 WorldWide Conferencing, LLC
Object Summary
object ConstructingParser extends AnyRef
object FatalError extends (java.lang.String) => FatalError
object XhtmlEntities extends AnyRef
object XhtmlParser extends AnyRef
Convenience method that instantiates, initializes and runs an XhtmlParser (c) Burak Emir