summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorburaq <buraq@epfl.ch>2005-04-25 08:45:15 +0000
committerburaq <buraq@epfl.ch>2005-04-25 08:45:15 +0000
commit5c5a13fc7e83f6d1abc8305591a62d932254d9d3 (patch)
tree3b0aa9098c57869dd9ddd81550d75ec734f4e600
parentad7e262eb8c2d9a51b256fa7bb0aba7b80cb4231 (diff)
downloadscala-5c5a13fc7e83f6d1abc8305591a62d932254d9d3.tar.gz
scala-5c5a13fc7e83f6d1abc8305591a62d932254d9d3.tar.bz2
scala-5c5a13fc7e83f6d1abc8305591a62d932254d9d3.zip
oops
-rw-r--r--sources/scala/xml/EntityRef.scala38
-rw-r--r--sources/scala/xml/ExternalID.scala69
2 files changed, 38 insertions, 69 deletions
diff --git a/sources/scala/xml/EntityRef.scala b/sources/scala/xml/EntityRef.scala
new file mode 100644
index 0000000000..192cf85797
--- /dev/null
+++ b/sources/scala/xml/EntityRef.scala
@@ -0,0 +1,38 @@
+/* __ *\
+** ________ ___ / / ___ Scala API **
+** / __/ __// _ | / / / _ | (c) 2003-2004, LAMP/EPFL **
+** __\ \/ /__/ __ |/ /__/ __ | **
+** /____/\___/_/ |_/____/_/ | | **
+** |/ **
+** $Id$
+\* */
+
+package scala.xml;
+
+/** an XML node for entity references
+ *
+ * @author buraq
+ * @param text the text contained in this node
+ **/
+
+case class EntityRef( entityName:String ) extends SpecialNode {
+
+ final override def typeTag$:Int = -5;
+
+ /** structural equality */
+ override def equals(x: Any): Boolean = x match {
+ case EntityRef(x) => x.equals(entityName);
+ case _ => false
+ }
+
+ /** the constant "#ENTITY"
+ */
+ def label = "#ENTITY";
+
+ override def hashCode() = entityName.hashCode();
+
+ /** appends "&amp; entityName;" to this stringbuffer */
+ def toString(sb:StringBuffer) =
+ sb.append("&").append(entityName).append(";");
+
+}
diff --git a/sources/scala/xml/ExternalID.scala b/sources/scala/xml/ExternalID.scala
deleted file mode 100644
index 47cf08f770..0000000000
--- a/sources/scala/xml/ExternalID.scala
+++ /dev/null
@@ -1,69 +0,0 @@
-/* __ *\
-** ________ ___ / / ___ Scala API **
-** / __/ __// _ | / / / _ | (c) 2003-2004, LAMP/EPFL **
-** __\ \/ /__/ __ |/ /__/ __ | **
-** /____/\___/_/ |_/____/_/ | | **
-** |/ **
-** $Id$
-\* */
-
-package scala.xml;
-
-/** an ExternalIDs - either PublicID or SystemID
- *
- * @author Burak Emir
- * @param target target name of this PI
- * @param text text contained in this node, may not contain "?>"
-**/
-
-class ExternalID ;
-
-/** a system identifier
- *
- * @author Burak Emir
- * @param systemLiteral the system identifier literal
-**/
-
-case class SystemID( systemLiteral:String ) extends ExternalID {
-
- if( !Parsing.checkSysID( systemLiteral ) )
- throw new IllegalArgumentException(
- "can't use both \" and ' in systemLiteral"
- );
- final override def toString() =
- Utility.systemLiteralToString( systemLiteral );
-}
-
-
-/** a public identifier
- *
- * @author Burak Emir
- * @param publicLiteral the public identifier literal
- * @param systemLiteral the system identifier literal
-**/
-case class PublicID( publicLiteral:String, systemLiteral:String ) extends ExternalID {
-
- if( !Parsing.checkPubID( publicLiteral ))
- throw new IllegalArgumentException(
- "publicLiteral must consist of PubidChars"
- );
- if( !Parsing.checkSysID( systemLiteral ) )
- throw new IllegalArgumentException(
- "can't use both \" and ' in systemLiteral"
- );
-
- /** the constant "#PI" */
- final def label = "#PI";
-
- /** always empty */
- final def attribute = Node.NoAttributes;
-
- /** always empty */
- final def child = Nil;
-
- /** returns "PUBLIC "+publicLiteral+" SYSTEM "+systemLiteral */
- final override def toString() =
- Utility.publicLiteralToString( publicLiteral )
- + Utility.systemLiteralToString( systemLiteral );
-
-}