All Downloads are FREE. Search and download functionalities are using the official Maven repository.

scala.xml.package.scala Maven / Gradle / Ivy

/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2003-2020, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |    (c) 2011-2020, Lightbend, Inc.       **
** /____/\___/_/ |_/____/_/ | |    http://scala-lang.org/               **
**                          |/                                          **
\*                                                                      */

package scala

/**
 * This library provides support for the XML literal syntax in Scala programs.
 * {{{
 * val planets: scala.xml.Elem = 
 *   
 *     Earth
 *     5.9742e24
 *     6378.14e3
 *   
 *   
 *     Mars
 *     0.64191e24
 *     3397.0e3
 *   
 * 
 * }}}
 *
 * 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 = 
 *   Sun
 *   { sunMass }
 *   { sunRadius }
 *   { 4 * Math.PI * Math.pow(sunRadius, 2) }
 *   { 4/3 * Math.PI * Math.pow(sunRadius, 3) }
 * 
 * }}}
 *
 * An XML element, for example `` and ``, 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
 * [[http://xerces.apache.org/ Xerces]] parser and is provided in Java
 * by [[javax.xml.parsers.SAXParser]].
 *
 * 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]].
 */
package object xml {
  val XercesClassName = "org.apache.xerces.parsers.SAXParser"

  type SAXException = org.xml.sax.SAXException
  type SAXParseException = org.xml.sax.SAXParseException
  type EntityResolver = org.xml.sax.EntityResolver
  type InputSource = org.xml.sax.InputSource
  type SAXParser = javax.xml.parsers.SAXParser
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy