From f15cab9b7fe396481bb5d1cfc51445a537d3c1c2 Mon Sep 17 00:00:00 2001 From: Burak Emir Date: Sat, 25 Mar 2006 12:17:25 +0000 Subject: added binding for xml prefix --- src/library/scala/xml/TopScope.scala | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/library/scala/xml/TopScope.scala b/src/library/scala/xml/TopScope.scala index abeaab3235..b3dcb3ab1d 100644 --- a/src/library/scala/xml/TopScope.scala +++ b/src/library/scala/xml/TopScope.scala @@ -11,15 +11,23 @@ package scala.xml; - +/** 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 contains(pre:String) = false; - */ - override def getURI(_prefix: String) = null; + override def getURI(_prefix: String) = + if(_prefix == "xml") + return "http://www.w3.org/XML/1998/namespace"; + else + return null; override def getPrefix(_uri: String) = null; + if(_uri == "http://www.w3.org/XML/1998/namespace") + return "xml"; + else + return null; override def toString() = ""; -- cgit v1.2.3