diff options
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 = |