Scala 2

API Specification

This document is the API specification for Scala 2.

Class Summary
class Atom [A]
The class Atom provides an XML node for text (PCDATA). It is used in both non-bound and bound XML representations.
case class Comment
The class Comment implements an XML node for comments.
class Document
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
case class Elem
The case class Elem extends the Node class, providing an immutable data object representing an XML element.
case class EntityRef
The class EntityRef implements an XML node for entity references.
case class Group
A hack to group XML nodes in one node for output.
case class MalformedAttributeException

abstract class 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
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
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
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
This class implements a wrapper around Seq[Node] that adds XPath and comprehension methods.
abstract class NodeTraverser
This class ...
class PrefixedAttribute
prefixed attributes always have a non-null namespace.
class PrettyPrinter
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
an XML node for processing instructions (PI)
abstract class SpecialNode
<code>SpecialNode</code> 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
The class Text implements an XML node for text (PCDATA). It is used in both non-bound and bound XML representations.
class TextBuffer
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

case class Unparsed
an XML node for unparsed content. It will be output verbatim, all bets are off regarding wellformedness etc.
class UnprefixedAttribute
unprefixed attributes have the null namespace, and no prefix field

Object Summary
object Node
This object provides methods ...
object NodeSeq
This object ...
case object Null

object Parsing
The object Parsing ...
object TextBuffer

case object TopScope
top level namespace scope. only contains the predefined binding for the "xml" prefix which is bound to "http://www.w3.org/XML/1998/namespace"
object Utility
The Utility object provides utility functions for processing instances of bound and not bound XML classes, as well as escaping text nodes.
object XML
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.