diff options
author | buraq <buraq@epfl.ch> | 2004-03-30 15:00:51 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2004-03-30 15:00:51 +0000 |
commit | 3b5c08c0077c6e43009a434bc26bd600ee2facd6 (patch) | |
tree | dd2a1a1455faa8a5b440bdec7fddbc50e74f4f44 /sources | |
parent | 4e3a699d7f8f0b6fe5cab3ca5310ea4055bd753f (diff) | |
download | scala-3b5c08c0077c6e43009a434bc26bd600ee2facd6.tar.gz scala-3b5c08c0077c6e43009a434bc26bd600ee2facd6.tar.bz2 scala-3b5c08c0077c6e43009a434bc26bd600ee2facd6.zip |
preparing for entity parsing
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scala/xml/EntityRef.scala | 34 | ||||
-rw-r--r-- | sources/scala/xml/Text.scala | 5 |
2 files changed, 36 insertions, 3 deletions
diff --git a/sources/scala/xml/EntityRef.scala b/sources/scala/xml/EntityRef.scala new file mode 100644 index 0000000000..8a0cc85cd3 --- /dev/null +++ b/sources/scala/xml/EntityRef.scala @@ -0,0 +1,34 @@ +/* __ *\ +** ________ ___ / / ___ Scala API ** +** / __/ __// _ | / / / _ | (c) 2003-2004, LAMP/EPFL ** +** __\ \/ /__/ __ |/ /__/ __ | ** +** /____/\___/_/ |_/____/_/ | | ** +** |/ ** +** $Id$ +\* */ + +package scala.xml; + +/** an XML node for text (PCDATA). Used in both non-bound and bound XML + * representations + * @author Burak Emir + * @param text the text contained in this node +**/ + +case class EntityRef( entityName:String ) extends Node { + /** the constant "#ENTITY" + */ + def label = "#ENTITY"; + + /** always empty */ + final def attribute = Nil; + + /** always empty */ + final def child = Nil; + + override def hashCode() = entityName.hashCode(); + + /** returns text, with some characters escaped according to XML spec */ + override def toString() = "&"+entityName+";"; + +} diff --git a/sources/scala/xml/Text.scala b/sources/scala/xml/Text.scala index 1c5ab0ddb2..4c9ecebfe6 100644 --- a/sources/scala/xml/Text.scala +++ b/sources/scala/xml/Text.scala @@ -9,9 +9,8 @@ package scala.xml; -import scala.collection.Map ; - -/** an XML node for text (PCDATA). Used in both non-bound and bound XML representations +/** an XML node for text (PCDATA). Used in both non-bound and bound XML + * representations * @author Burak Emir * @param text the text contained in this node **/ |