summaryrefslogtreecommitdiff
path: root/src/library/scala/xml/TopScope.scala
blob: d1d421b218ebcc62a9c83fa4830a88d8908d7f2c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*                     __                                               *\
**     ________ ___   / /  ___     Scala API                            **
**    / __/ __// _ | / /  / _ |    (c) 2002-2007, LAMP/EPFL             **
**  __\ \/ /__/ __ |/ /__/ __ |    http://scala-lang.org/               **
** /____/\___/_/ |_/____/_/ | |                                         **
**                          |/                                          **
\*                                                                      */

// $Id$

package scala.xml

import Predef._

/** top level namespace scope. only contains the predefined binding
 *  for the "xml" prefix which is bound to
 *  "http://www.w3.org/XML/1998/namespace"
 */
case object TopScope extends NamespaceBinding(null, null, null) {

  override def getURI(prefix1: String): String =
    if(prefix1 == "xml" /*XML.xml*/)
      "http://www.w3.org/XML/1998/namespace"
    else
      null

  override def getPrefix(uri1: String): String =
    if (uri1 == "http://www.w3.org/XML/1998/namespace" /*XML.namespace*/)
      "xml" //XML.xml
    else
      null

  override def toString() = ""

  override def toString(stop: NamespaceBinding) = ""

  override def toString(sb: StringBuilder, ignore: NamespaceBinding) = {}

}