scala.xml.parsing

Type members

Classlikes

trait ConsoleErrorHandler extends DefaultHandler
abstract class ConstructingHandler extends MarkupHandler

Implementation of MarkupHandler that constructs nodes.

Implementation of MarkupHandler that constructs nodes.

Authors

Burak Emir

Companion
class
class ConstructingParser(val input: Source, val preserveWS: Boolean) extends ConstructingHandler with ExternalSources with MarkupParser

An xml parser. parses XML and invokes callback methods of a MarkupHandler. Don't forget to call next.ch 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.

An xml parser. parses XML and invokes callback methods of a MarkupHandler. Don't forget to call next.ch 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]) {
   val url = args(0)
   val src = scala.io.Source.fromURL(url)
   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
   println("finished parsing")
   val out = ppr.format(ele)
   println(out)
 }
}
Companion
object
abstract class DefaultMarkupHandler extends MarkupHandler

Default implementation of markup handler always returns NodeSeq.Empty

Default implementation of markup handler always returns NodeSeq.Empty

Authors

Burak Emir

abstract class FactoryAdapter extends DefaultHandler with XMLLoader[Node]

SAX adapter class, for use with Java SAX parser. Keeps track of namespace bindings, without relying on namespace handling of the underlying SAX parser.

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(msg: String) extends RuntimeException

!!! This is poorly named, but I guess it's in the API.

!!! This is poorly named, but I guess it's in the API.

abstract class MarkupHandler

class that handles markup - provides callback methods to MarkupParser. the default is nonvalidating behaviour

class that handles markup - provides callback methods to MarkupParser. the default is nonvalidating behaviour

Authors

Burak Emir

Todo

can we ignore more entity declarations (i.e. those with extIDs)?

expanding entity references

trait MarkupParser extends MarkupParserCommon with TokenTests

An XML parser.

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.

Authors

Burak Emir

nobinding adaptor providing callbacks to parser to create elements. implements hash-consing

nobinding adaptor providing callbacks to parser to create elements. implements hash-consing

trait TokenTests

Helper functions for parsing XML fragments

Helper functions for parsing XML fragments

Authors

(c) David Pollak 2007 WorldWide Conferencing, LLC.

class XhtmlParser(val input: Source) extends ConstructingHandler with MarkupParser with ExternalSources

An XML Parser that preserves CDATA blocks and knows about scala.xml.parsing.XhtmlEntities.

An XML Parser that preserves CDATA blocks and knows about scala.xml.parsing.XhtmlEntities.

Authors

(c) David Pollak, 2007 WorldWide Conferencing, LLC.

Companion
object
object XhtmlParser

Convenience method that instantiates, initializes and runs an XhtmlParser.

Convenience method that instantiates, initializes and runs an XhtmlParser.

Authors

Burak Emir

Companion
class