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
t

scala.xml.factory

LoggedNodeFactory

trait LoggedNodeFactory[A <: Node] extends NodeFactory[A]

This class logs what the nodefactory is actually doing. If you want to see what happens during loading, use it like this:

object testLogged extends App {
val x = new scala.xml.parsing.NoBindingFactoryAdapter
with scala.xml.factory.LoggedNodeFactory[scala.xml.Elem] {
override def log(s: String) = println(s)
}

Console.println("Start")
val doc = x.load(new java.net.URL("http://example.com/file.xml"))
Console.println("End")
Console.println(doc)
}
Annotations
@deprecated
Deprecated

(Since version 2.11) This trait will be removed.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. LoggedNodeFactory
  2. NodeFactory
  3. AnyRef
  4. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def create(pre: String, name: String, attrs: MetaData, scope: NamespaceBinding, children: collection.Seq[Node]): A
    Attributes
    protected
    Definition Classes
    NodeFactory

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int
    Definition Classes
    AnyRef → Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  4. final val CACHE: Int(1)
  5. final val FULL: Int(2)
  6. final val NONE: Int(0)
  7. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  8. val cache: HashMap[Int, List[A]]
    Definition Classes
    NodeFactory
  9. def clone(): AnyRef
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )
  10. def construct(hash: Int, old: List[A], pre: String, name: String, attrSeq: MetaData, scope: NamespaceBinding, children: collection.Seq[Node]): A
    Attributes
    protected
    Definition Classes
    NodeFactory
  11. final def eq(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  12. def eqElements(ch1: collection.Seq[Node], ch2: collection.Seq[Node]): Boolean
    Definition Classes
    NodeFactory
  13. def equals(arg0: Any): Boolean
    Definition Classes
    AnyRef → Any
  14. def finalize(): Unit
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  15. final def getClass(): Class[_]
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  16. def hashCode(): Int
    Definition Classes
    AnyRef → Any
    Annotations
    @native()
  17. val ignoreComments: Boolean
    Definition Classes
    NodeFactory
  18. val ignoreProcInstr: Boolean
    Definition Classes
    NodeFactory
  19. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  20. def log(msg: String): Unit
  21. val logComment: Boolean
  22. val logCompressLevel: Int

    0 = no logging, 1 = cache hits, 2 = detail

  23. val logNode: Boolean
  24. val logProcInstr: Boolean
  25. val logText: Boolean
  26. def makeComment(s: String): collection.Seq[Comment]
    Definition Classes
    LoggedNodeFactoryNodeFactory
  27. def makeNode(pre: String, label: String, attrSeq: MetaData, scope: NamespaceBinding, children: collection.Seq[Node]): A

    logged version of makeNode method

    logged version of makeNode method

    Definition Classes
    LoggedNodeFactoryNodeFactory
  28. def makeProcInstr(t: String, s: String): collection.Seq[ProcInstr]
    Definition Classes
    LoggedNodeFactoryNodeFactory
  29. def makeText(s: String): Text
    Definition Classes
    LoggedNodeFactoryNodeFactory
  30. final def ne(arg0: AnyRef): Boolean
    Definition Classes
    AnyRef
  31. def nodeEquals(n: Node, pre: String, name: String, attrSeq: MetaData, scope: NamespaceBinding, children: collection.Seq[Node]): Boolean
    Definition Classes
    NodeFactory
  32. final def notify(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  33. final def notifyAll(): Unit
    Definition Classes
    AnyRef
    Annotations
    @native()
  34. final def synchronized[T0](arg0: ⇒ T0): T0
    Definition Classes
    AnyRef
  35. def toString(): String
    Definition Classes
    AnyRef → Any
  36. final def wait(): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  37. final def wait(arg0: Long, arg1: Int): Unit
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  38. final def wait(arg0: Long): Unit
    Definition Classes
    AnyRef
    Annotations
    @native() @throws( ... )

Inherited from NodeFactory[A]

Inherited from AnyRef

Inherited from Any

Ungrouped