From 5c5a13fc7e83f6d1abc8305591a62d932254d9d3 Mon Sep 17 00:00:00 2001 From: buraq Date: Mon, 25 Apr 2005 08:45:15 +0000 Subject: oops --- sources/scala/xml/EntityRef.scala | 38 +++++++++++++++++++++ sources/scala/xml/ExternalID.scala | 69 -------------------------------------- 2 files changed, 38 insertions(+), 69 deletions(-) create mode 100644 sources/scala/xml/EntityRef.scala delete mode 100644 sources/scala/xml/ExternalID.scala 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 "& 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 ); - -} -- cgit v1.2.3