*** empty log message ***
git-svn-id: http://lampsvn.epfl.ch/svn-repos/scala/scala/trunk@2035 5e8d7ff9-d8ef-0310-90f0-a4852d11357a
This commit is contained in:
parent
e85de66843
commit
7095233999
|
@ -0,0 +1,20 @@
|
|||
/* __ *\
|
||||
** ________ ___ / / ___ Scala API **
|
||||
** / __/ __// _ | / / / _ | (c) 2003, LAMP/EPFL **
|
||||
** __\ \/ /__/ __ |/ /__/ __ | **
|
||||
** /____/\___/_/ |_/____/_/ | | **
|
||||
** |/ **
|
||||
** $Id$
|
||||
\* */
|
||||
|
||||
package scala;
|
||||
|
||||
|
||||
/** An xml element
|
||||
*
|
||||
* @author Burak Emir
|
||||
* @version 1.0, 26.11.2003
|
||||
*/
|
||||
abstract case class %(s:Symbol,ns:Seq[scala.xml.Node])
|
||||
extends scala.xml.nobinding.Element(s,ns) { }
|
||||
|
|
@ -28,9 +28,11 @@ case class Symbol(name: String) {
|
|||
|
||||
override def toString() = "'" + name;
|
||||
|
||||
/* WAITING FOR SCALADOC BUG TO BE FIXED
|
||||
def % (ch:Node*) = new Element(this, List.fromIterator(ch.elements)) {
|
||||
override def attributes = map;
|
||||
};
|
||||
*/
|
||||
|
||||
def % (a:Attribute) = {
|
||||
map = map.update(a.name, a.value);
|
||||
|
@ -38,6 +40,10 @@ case class Symbol(name: String) {
|
|||
}
|
||||
def -> (value:String) = new Attribute( name, value );
|
||||
|
||||
def apply( ch:Node* ) = new Element(this, List.fromIterator(ch.elements)) {
|
||||
override def attributes = map;
|
||||
};
|
||||
|
||||
class Attribute( n:String, v:String ) {
|
||||
final val name = n;
|
||||
final val value = v;
|
||||
|
|
|
@ -8,7 +8,7 @@ import scala.collection.Map;
|
|||
abstract class Element {
|
||||
|
||||
def getName: String; // the real element name
|
||||
def getChildren: Seq[ Element ]; // the children
|
||||
def getChildren: Seq[ Node ]; // the children
|
||||
def getAttribs: Map[ String, String ]; // disabled updates
|
||||
def setAttribs( m:Map[ String, String ] ):Unit ;
|
||||
|
||||
|
|
Loading…
Reference in New Issue