diff options
author | buraq <buraq@epfl.ch> | 2003-06-16 08:35:18 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2003-06-16 08:35:18 +0000 |
commit | be4f8d7916b08ffdec9f9170b10d8ae4d673f966 (patch) | |
tree | f621fc7830cf651e481ac732e3f441ca242b747f | |
parent | 65331423790c29a186904dde5c878c4ecff7e805 (diff) | |
download | scala-be4f8d7916b08ffdec9f9170b10d8ae4d673f966.tar.gz scala-be4f8d7916b08ffdec9f9170b10d8ae4d673f966.tar.bz2 scala-be4f8d7916b08ffdec9f9170b10d8ae4d673f966.zip |
removed attributes, need HashMap or something s...
removed attributes, need HashMap or something similar
-rw-r--r-- | sources/scala/xml/Element.scala | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/sources/scala/xml/Element.scala b/sources/scala/xml/Element.scala index 02172396e4..66542db82b 100644 --- a/sources/scala/xml/Element.scala +++ b/sources/scala/xml/Element.scala @@ -1,10 +1,24 @@ package scala.xml ; +/** interface to XML elements. used by dtd2scala tool and the generated XML parser interfaces. + * sorry, no attributes yet (needs working HashMap). + * future revisions might use sequence instead of list. + */ + abstract class Element { def getName: String; // the real element name def getChildren: List[Element]; // the children - def getAttribs: Map[ String, String ]; +// def getAttribs: Map[ String, String ]; // disabled + + def toXML( elems:List[Element] ):String = elems match { + case head :: tail => head.toString() + toXML( tail ); + case Nil => ""; + } + + def toXML: String = + "<" + getName +">" + toXML( getChildren ) + "</" + getName +">" + /* def toXML : String = { |