Packages

  • package root
    Definition Classes
    root
  • package scala
    Definition Classes
    root
  • package xml

    This library provides support for the XML literal syntax in Scala programs.

    This library provides support for the XML literal syntax in Scala programs.

    val planets: scala.xml.Elem = <planets>
      <planet id="earth">
        <title>Earth</title>
        <mass unit="kg">5.9742e24</mass>
        <radius unit="m">6378.14e3</radius>
      </planet>
      <planet id="mars">
        <title>Mars</title>
        <mass unit="kg">0.64191e24</mass>
        <radius unit="m">3397.0e3</radius>
      </planet>
    </planets>

    Additionally, you can mix Scala expressions in your XML elements by using the curly brace notation:

    val sunMass = 1.99e30
    val sunRadius = 6.96e8
    val star = <star>
      <title>Sun</title>
      <mass unit="kg">{ sunMass }</mass>
      <radius unit="m">{ sunRadius }</radius>
      <surface unit="m²">{ 4 * Math.PI * Math.pow(sunRadius, 2) }</surface>
      <volume unit="m³">{ 4/3 * Math.PI * Math.pow(sunRadius, 3) }</volume>
    </star>

    An XML element, for example <star/> and <planet/>, is represented in this library as a case class, scala.xml.Elem.

    The sub-elements of XML values share a common base class, scala.xml.Node.

    However, the non-element declarations found in XML files share a different common base class, scala.xml.dtd.Decl. Additionally, document type declarations are represented by a different trait, scala.xml.dtd.DTD.

    For reading and writing XML data to and from files, see scala.xml.XML. The default parser of XML data is the Xerces parser and is provided in Java by javax.xml.parsers.SAXParser.

    A less greedy XML reader can return data as a sequential collection of events, see scala.xml.pull.XMLEventReader.

    For more control of the input, use the parser written in Scala that is provided, scala.xml.parsing.ConstructingParser.

    For working with XHTML input, use scala.xml.parsing.XhtmlParser.

    For more control of the output, use the scala.xml.PrettyPrinter.

    Utility methods for working with XML data are provided in scala.xml.Utility.

    XML values in Scala are immutable, but you can traverse and transform XML data with a scala.xml.transform.RuleTransformer.

    Definition Classes
    scala
  • package factory
    Definition Classes
    xml
  • Binder
  • LoggedNodeFactory
  • NodeFactory
  • XMLLoader

abstract class Binder extends ValidatingMarkupHandler

Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. Binder
  2. ValidatingMarkupHandler
  3. MarkupHandler
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Instance Constructors

  1. new Binder(preserveWS: Boolean)

Abstract Value Members

  1. abstract def elem(pos: Int, pre: String, label: String, attrs: MetaData, scope: NamespaceBinding, empty: Boolean, args: NodeSeq): NodeSeq

    callback method invoked by MarkupParser after parsing an element, between the elemStart and elemEnd callbacks

    callback method invoked by MarkupParser after parsing an element, between the elemStart and elemEnd callbacks

    pos

    the position in the source file

    pre

    the prefix

    label

    the local name

    attrs

    the attributes (metadata)

    empty

    true if the element was previously empty; false otherwise.

    args

    the children of this element

    Definition Classes
    MarkupHandler
  2. abstract def reportValidationError(pos: Int, str: String): Unit

    report a syntax error

    report a syntax error

    Definition Classes
    ValidatingMarkupHandler

Concrete Value Members

  1. final def attListDecl(name: String, attList: List[AttrDecl]): Unit
    Definition Classes
    ValidatingMarkupHandlerMarkupHandler
  2. final def comment(pos: Int, txt: String): Comment

    callback method invoked by MarkupParser after parsing comment.

    callback method invoked by MarkupParser after parsing comment.

    Definition Classes
    BinderMarkupHandler
  3. var declCurrent: ElemDecl
    Definition Classes
    ValidatingMarkupHandler
  4. var declStack: List[ElemDecl]
    Definition Classes
    ValidatingMarkupHandler
  5. var decls: List[Decl]
    Definition Classes
    MarkupHandler
  6. final def elemDecl(name: String, cmstr: String): Unit
    Definition Classes
    ValidatingMarkupHandlerMarkupHandler
  7. def elemEnd(pos: Int, pre: String, label: String): Unit

    callback method invoked by MarkupParser after end-tag of element.

    callback method invoked by MarkupParser after end-tag of element.

    pos

    the position in the source file

    pre

    the prefix

    label

    the local name

    Definition Classes
    ValidatingMarkupHandlerMarkupHandler
  8. def elemStart(pos: Int, pre: String, label: String, attrs: MetaData, scope: NamespaceBinding): Unit

    callback method invoked by MarkupParser after start-tag of element.

    callback method invoked by MarkupParser after start-tag of element.

    pos

    the position in the sourcefile

    pre

    the prefix

    label

    the local name

    attrs

    the attributes (metadata)

    Definition Classes
    ValidatingMarkupHandlerMarkupHandler
  9. def endDTD(n: String): Unit
    Definition Classes
    ValidatingMarkupHandlerMarkupHandler
  10. var ent: Map[String, EntityDecl]
    Definition Classes
    MarkupHandler
  11. final def entityRef(pos: Int, n: String): EntityRef

    callback method invoked by MarkupParser after parsing entity ref.

    callback method invoked by MarkupParser after parsing entity ref.

    Definition Classes
    BinderMarkupHandler
    To do

    expanding entity references

  12. final val isValidating: Boolean(true)
    Definition Classes
    ValidatingMarkupHandlerMarkupHandler
  13. def lookupElemDecl(Label: String): ElemDecl
    Definition Classes
    MarkupHandler
  14. final def notationDecl(notat: String, extID: ExternalID): Unit
    Definition Classes
    ValidatingMarkupHandlerMarkupHandler
  15. def parameterEntityDecl(name: String, edef: EntityDef): Unit
    Definition Classes
    MarkupHandler
  16. def parsedEntityDecl(name: String, edef: EntityDef): Unit
    Definition Classes
    MarkupHandler
  17. final def peReference(name: String): Unit
    Definition Classes
    ValidatingMarkupHandlerMarkupHandler
  18. val preserveWS: Boolean
  19. final def procInstr(pos: Int, target: String, txt: String): ProcInstr

    callback method invoked by MarkupParser after parsing PI.

    callback method invoked by MarkupParser after parsing PI.

    Definition Classes
    BinderMarkupHandler
  20. var qCurrent: Int
    Definition Classes
    ValidatingMarkupHandler
  21. var qStack: List[Int]
    Definition Classes
    ValidatingMarkupHandler
  22. def replacementText(entityName: String): Source
    Definition Classes
    MarkupHandler
  23. def reportSyntaxError(pos: Int, str: String): Unit
    Definition Classes
    BinderMarkupHandler
  24. var result: NodeBuffer
  25. var rootLabel: String
    Definition Classes
    ValidatingMarkupHandler
  26. final def text(pos: Int, txt: String): Text

    callback method invoked by MarkupParser after parsing text.

    callback method invoked by MarkupParser after parsing text.

    Definition Classes
    BinderMarkupHandler
  27. final def traverse(n: Node): Unit
  28. final def unparsedEntityDecl(name: String, extID: ExternalID, notat: String): Unit
    Definition Classes
    ValidatingMarkupHandlerMarkupHandler
  29. final def validate(n: Node): Node

Deprecated Value Members

  1. def log(msg: String): Unit
    Definition Classes
    MarkupHandler
    Annotations
    @deprecated
    Deprecated

    (Since version 2.11) This method and its usages will be removed. Use a debugger to debug code.