diff options
author | buraq <buraq@epfl.ch> | 2003-07-28 14:51:20 +0000 |
---|---|---|
committer | buraq <buraq@epfl.ch> | 2003-07-28 14:51:20 +0000 |
commit | 2c9c03c154e5692f57abe675db4e24fde6f19926 (patch) | |
tree | 853eb0a0627d891a886e9ae4b5c8b32909ef0774 /sources | |
parent | 3765cc0c1199ff641451c9894530f86135d93e6d (diff) | |
download | scala-2c9c03c154e5692f57abe675db4e24fde6f19926.tar.gz scala-2c9c03c154e5692f57abe675db4e24fde6f19926.tar.bz2 scala-2c9c03c154e5692f57abe675db4e24fde6f19926.zip |
added comments
Diffstat (limited to 'sources')
-rw-r--r-- | sources/scala/xml/Generic.scala | 8 | ||||
-rw-r--r-- | sources/scala/xml/ScalaFactoryAdapter.scala | 12 |
2 files changed, 17 insertions, 3 deletions
diff --git a/sources/scala/xml/Generic.scala b/sources/scala/xml/Generic.scala index b7193b7498..d7d2a81445 100644 --- a/sources/scala/xml/Generic.scala +++ b/sources/scala/xml/Generic.scala @@ -1,5 +1,10 @@ package scala.xml; +/** Generic.load( <fileName> ) will load the xml document from file and + * create a tree with scala.Labelled, PCDATA and scala.Symbol objects. + * Text can appear within PCDATA at the leaves. + */ + object Generic { def load( filename:String ):Labelled = { @@ -35,7 +40,6 @@ object Generic { new PCDATA( text ); }; - } // GenericFactoryAdapter - + } // GenericFactoryAdapter } diff --git a/sources/scala/xml/ScalaFactoryAdapter.scala b/sources/scala/xml/ScalaFactoryAdapter.scala index e84caa1269..081e127e45 100644 --- a/sources/scala/xml/ScalaFactoryAdapter.scala +++ b/sources/scala/xml/ScalaFactoryAdapter.scala @@ -3,6 +3,12 @@ package scala.xml ; import scala.xml.javaAdapter.Map ; import scala.xml.javaAdapter.HashMap ; +/** a Scala specific dtd2scala.FactoryAdapter, which plays the SAX content handler for the SAX parser + * It implements the three callback methods elementContainsText, createElement and createPCDATA. + * DTDs imported with the dtd2scala tool all use this class as interface to the SAX XML parser, by + * giving concrete values for the factory maps f and g. + */ + abstract class ScalaFactoryAdapter extends dtd2scala.FactoryAdapter() { @@ -31,9 +37,13 @@ abstract class ScalaFactoryAdapter res } - + /** a mapping from a element name (string) to an element constructor (constr:Seq[Element] => Element) + */ val f: Map[ String, Seq[Element] => Element ]; + /** a mapping from an element name (string) to a truth value indicating whether text (PCDATA) may appear as + */ + val g: Map[ String, boolean ] ; def elementContainsText( name:java.lang.String ):boolean = |