Scala 2.5.1-final

API Specification

This document is the API specification for Scala Library Documentation

Class Summary
class Atom [+A](val data : A) extends SpecialNode
The class Atom provides an XML node for text (PCDATA). It is used in both non-bound and bound XML representations.
case class Comment (val commentText : String) extends SpecialNode with Product
The class Comment implements an XML node for comments.
class Document extends NodeSeq with XMLEvent
A document information item (according to InfoSet spec). The comments are copied from the Infoset spec, only augmented with some information on the Scala types for definitions that might have no value. also plays the role of an XMLEvent for pull parsing
class Elem (val override prefix : String, val label : String, val override attributes : MetaData, val override scope : NamespaceBinding, val child : Node*) extends Node
The case class Elem extends the Node class, providing an immutable data object representing an XML element.
case class EntityRef (val entityName : String) extends SpecialNode with Product
The class EntityRef implements an XML node for entity references.
case class Group (val nodes : Seq[Node]) extends Node with Product
A hack to group XML nodes in one node for output.
class HasKeyValue (key : String) extends AnyRef

Use this class to match on (unprefixed) attribute values

  val hasName = new HasKeyValue("name")
  node match {
    case Node("foo", hasName(x), _*) => x // foo had attribute with key "name" and with value x
case class MalformedAttributeException (val msg : String) extends RuntimeException with Product
abstract class MetaData extends Collection[MetaData]

Attribute information item, and linked list of attribute information items. These are triples consisting of prefix,key,value. To obtain the namespace, getNamespace must be called with the parent. If next is null, this is the last attribute in the MetaData list.

Either an UnprefixedAttribute or a PrefixedAttribute

class NamespaceBinding (val prefix : String, val uri : String, val parent : NamespaceBinding) extends AnyRef
The class NamespaceBinding represents namespace bindings and scopes. The binding for the default namespace is treated as a null prefix. the absent namespace is represented with the null uri. Neither prefix nor uri may be empty, which is not checked.
abstract class Node extends NodeSeq
An abstract class representing XML with nodes of a labelled tree. This class contains an implementation of a subset of XPath for navigation.
class NodeBuffer extends ArrayBuffer[Node]

This class acts as a Buffer for nodes. If it is used as a sequence of nodes Seq[Node], it must be ensured that no updates occur after that point, because scala.xml.Node is assumed to be immutable.

Despite this being a sequence, don't use it as key in a hashtable. Calling the hashcode function will result in a runtime error.

abstract class NodeSeq extends Seq[Node]
This class implements a wrapper around Seq[Node] that adds XPath and comprehension methods.
abstract class NodeTraverser extends MarkupHandler
This class ...
class PrefixedAttribute (val pre : String, val key : String, val value : Seq[Node], val next : MetaData) extends MetaData
prefixed attributes always have a non-null namespace.
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.
case class ProcInstr (val target : String, val proctext : String) extends SpecialNode with Product
an XML node for processing instructions (PI)
abstract class SpecialNode extends Node with XMLEvent

SpecialNode is a special XML node which represents either text (PCDATA), a comment, a PI, or an entity ref.

SpecialNodes also play the role of XMLEvents for pull-parsing.

case class Text (val _data : String) extends Atom[String] with Product
The class Text implements an XML node for text (PCDATA). It is used in both non-bound and bound XML representations.
class TextBuffer extends AnyRef
The class TextBuffer is for creating text nodes without surplus whitespace. All occurrences of one or more whitespace in strings appended with the append method will be replaced by a single space character, and leading and trailing space will be removed completely.
abstract class TypeSymbol extends AnyRef
case class Unparsed (val _data : String) extends Atom[String] with Product
An XML node for unparsed content. It will be output verbatim, all bets are off regarding wellformedness etc.
class UnprefixedAttribute (val key : String, val value : Seq[Node], next1 : MetaData) extends MetaData
Unprefixed attributes have the null namespace, and no prefix field
Object Summary
object Elem extends AnyRef
object Node extends AnyRef
This object provides methods ...
object NodeSeq extends AnyRef
This object ...
case object Null extends MetaData with Product
object Parsing extends AnyRef
The object Parsing ...
object QNode extends AnyRef
This object provides an extractor method to match a qualified node with its namespace URI
object TextBuffer extends AnyRef
case object TopScope extends NamespaceBinding with Product
top level namespace scope. only contains the predefined binding for the "xml" prefix which is bound to ""
object Utility extends TokenTests
The Utility object provides utility functions for processing instances of bound and not bound XML classes, as well as escaping text nodes.
object XML extends AnyRef
The object XML provides constants, and functions to load and save XML elements. Use this when data binding is not desired, i.e. when XML is handled using Symbol nodes.