summaryrefslogtreecommitdiff
path: root/sources
diff options
context:
space:
mode:
authorburaq <buraq@epfl.ch>2003-12-19 12:07:22 +0000
committerburaq <buraq@epfl.ch>2003-12-19 12:07:22 +0000
commitd6cb921038f56fd3aa0f74700935f1972a9ec4b7 (patch)
treefdaab4173d53dae1b6895e9207eafdc2862ee8d2 /sources
parent1dcdd042ac1de864cc505371264b551358f498e2 (diff)
downloadscala-d6cb921038f56fd3aa0f74700935f1972a9ec4b7.tar.gz
scala-d6cb921038f56fd3aa0f74700935f1972a9ec4b7.tar.bz2
scala-d6cb921038f56fd3aa0f74700935f1972a9ec4b7.zip
handling of attribUTES
Diffstat (limited to 'sources')
-rw-r--r--sources/scala/xml/nobinding/NoBindingFactoryAdapter.scala11
1 files changed, 7 insertions, 4 deletions
diff --git a/sources/scala/xml/nobinding/NoBindingFactoryAdapter.scala b/sources/scala/xml/nobinding/NoBindingFactoryAdapter.scala
index 71e6a2797d..488ad0fba8 100644
--- a/sources/scala/xml/nobinding/NoBindingFactoryAdapter.scala
+++ b/sources/scala/xml/nobinding/NoBindingFactoryAdapter.scala
@@ -1,6 +1,7 @@
package scala.xml.nobinding;
import scala.collection.mutable.HashMap ;
+import scala.collection.immutable.ListMap ;
import scala.xml.{Node,Text,FactoryAdapter,Utility} ;
import org.xml.sax.InputSource;
@@ -18,19 +19,21 @@ class NoBindingFactoryAdapter extends FactoryAdapter {
val elHashCode = Utility.hashCode( label, attrs, children ) ;
+ val attrList = attrs.toList;
+
cache.get( elHashCode ).match{
case Some(cachedElem) =>
//System.err.println("[using cached elem +"+cachedElem.toXML+"!]");
cachedElem
case None => val el = if( children.isEmpty ) {
new Symbol( label ) {
- override def attributes = attrs;
- override def hashCode() = Utility.hashCode( label, attrs.toList.hashCode(), children );
+ override def attributes = ListMap.Empty[String,String].incl( attrList );
+ override def hashCode() = Utility.hashCode( label, attrList.hashCode(), children );
};
} else {
new Symbol( label, children:_* ) {
- override def attributes = attrs;
- override def hashCode() = Utility.hashCode( label, attrs.toList.hashCode(), children );
+ override def attributes = ListMap.Empty[String,String].incl( attrList );
+ override def hashCode() = Utility.hashCode( label, attrList.hashCode(), children );
};
}
cache.update( elHashCode, el );