summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorburaq <buraq@epfl.ch>2004-06-22 21:22:15 +0000
committerburaq <buraq@epfl.ch>2004-06-22 21:22:15 +0000
commit2416fb741615f4f2b729559b235876bf5c524194 (patch)
tree6b83306d4c1c30e9f7225f8581c312f2adb7429f
parent5a1bdae3502017c0a1ace03691a8036fe9620b9b (diff)
downloadscala-2416fb741615f4f2b729559b235876bf5c524194.tar.gz
scala-2416fb741615f4f2b729559b235876bf5c524194.tar.bz2
scala-2416fb741615f4f2b729559b235876bf5c524194.zip
namespace
-rw-r--r--config/list/library.lst1
-rw-r--r--sources/scala/tools/scalac/ast/parser/MarkupParser.scala32
-rw-r--r--sources/scala/xml/CharData.scala4
-rw-r--r--sources/scala/xml/Comment.scala11
-rw-r--r--sources/scala/xml/Elem.scala23
-rw-r--r--sources/scala/xml/EntityRef.scala11
-rw-r--r--sources/scala/xml/Node.scala8
-rw-r--r--sources/scala/xml/ProcInstr.scala11
-rw-r--r--sources/scala/xml/Text.scala11
-rw-r--r--sources/scala/xml/Utility.scala8
-rw-r--r--sources/scala/xml/nobinding/NoBindingFactoryAdapter.scala6
-rw-r--r--test/files/jvm/xmlLiterals.scala44
-rw-r--r--test/files/jvm/xmlstuff.scala110
13 files changed, 130 insertions, 150 deletions
diff --git a/config/list/library.lst b/config/list/library.lst
index 3320aa99ee..f0eefeea51 100644
--- a/config/list/library.lst
+++ b/config/list/library.lst
@@ -170,6 +170,7 @@ xml/NodeSeq.scala
xml/Parsing.scala
xml/PrettyPrinter.scala
xml/ProcInstr.scala
+xml/SpecialNode.scala
xml/Text.scala
xml/TextBuffer.scala
xml/Utility.scala
diff --git a/sources/scala/tools/scalac/ast/parser/MarkupParser.scala b/sources/scala/tools/scalac/ast/parser/MarkupParser.scala
index 6e5a73ee4d..19ef5493f3 100644
--- a/sources/scala/tools/scalac/ast/parser/MarkupParser.scala
+++ b/sources/scala/tools/scalac/ast/parser/MarkupParser.scala
@@ -156,11 +156,16 @@ class MarkupParser( unit:Unit, s:Scanner, p:Parser, preserveWS:boolean ) {
// create scala xml tree
- def mkXML(pos:int, isPattern:boolean, t:Tree, args:Array[Tree]):Tree = {
+ /**
+ * @arg namespace: a Tree of type defs.STRING_TYPE
+ * @arg label: a Tree of type defs.STRING_TYPE
+ * @todo map: a map of attributes !!!
+ */
+ def mkXML(pos:int, isPattern:boolean, namespace:Tree, label:Tree, args:Array[Tree]):Tree = {
if( isPattern ) {
val ts = new myTreeList();
- ts.append( new Tree$Ident( Names.PATTERN_WILDCARD ) );
- ts.append( t );
+ ts.append( namespace );
+ ts.append( label );
ts.append( new Tree$Ident( Names.PATTERN_WILDCARD ) );
ts.append( convertToText( true, args ) );
make.Apply(pos,
@@ -168,9 +173,9 @@ class MarkupParser( unit:Unit, s:Scanner, p:Parser, preserveWS:boolean ) {
ts.toArray())
} else {
val constrArgs = if( 0 == args.length ) {
- Predef.Array[Tree]( gen.mkIntLit(pos, 0), t, _emptyMap( pos ) )
+ Predef.Array[Tree]( namespace, label, _emptyMap( pos ) )
} else {
- Predef.Array[Tree]( gen.mkIntLit(pos, 0), t, _emptyMap( pos ), make.Typed(
+ Predef.Array[Tree]( namespace, label, _emptyMap( pos ), make.Typed(
pos, makeXMLseq(pos, args ), make.Ident(pos, TypeNames.WILDCARD_STAR)))
};
make.Apply( pos, _scala_xml_Elem( pos ), constrArgs )
@@ -283,11 +288,18 @@ class MarkupParser( unit:Unit, s:Scanner, p:Parser, preserveWS:boolean ) {
def makeXMLpat(pos:int, n:Name, args:Array[Tree]):Tree =
- mkXML(pos, true, gen.mkStringLit( pos, n.toString() ), args);
-
- def makeXML(pos:int, n:Name, args:Array[Tree]):Tree =
- mkXML(pos, false, gen.mkStringLit( pos, n.toString() ), args);
-
+ mkXML(pos, true, new Tree$Ident( Names.PATTERN_WILDCARD ), gen.mkStringLit( pos, n.toString() ), args);
+
+ def makeXML(pos:int, n:Name, args:Array[Tree]):Tree = {
+ var s = n.toString();
+ val i = n.indexOf(':');
+ var pref = "";
+ if( i > -1 ) {
+ pref = s.substring( 0, i );
+ s = s.substring( i, s.length() );
+ }
+ mkXML(pos, false, gen.mkStringLit(pos, pref.toString()), gen.mkStringLit(pos, n.toString()), args);
+ }
def convertToText(isPattern:Boolean, t:Tree):Tree = t match {
case _:Tree$Literal => makeText(t.pos, isPattern, t);
case _ => t
diff --git a/sources/scala/xml/CharData.scala b/sources/scala/xml/CharData.scala
index 6b6d031fd4..19e12d88f3 100644
--- a/sources/scala/xml/CharData.scala
+++ b/sources/scala/xml/CharData.scala
@@ -27,8 +27,8 @@ case class CharData( text:String ) extends Node {
*/
def label = "#CDATA";
- /** always 0 */
- final val namespaceCode = 0;
+ /** always Node.EmptyNamespace */
+ final def namespace = Node.EmptyNamespace;
/** always empty */
final def attribute = Node.NoAttributes;
diff --git a/sources/scala/xml/Comment.scala b/sources/scala/xml/Comment.scala
index 65cecd66c9..2b646ad001 100644
--- a/sources/scala/xml/Comment.scala
+++ b/sources/scala/xml/Comment.scala
@@ -17,7 +17,7 @@ import scala.collection.immutable ;
* @param text text contained in this node, may not contain "--"
**/
-case class Comment( text:String ) extends Node {
+case class Comment( text:String ) extends SpecialNode {
final override def typeTag$:Int = -3;
@@ -32,15 +32,6 @@ case class Comment( text:String ) extends Node {
/** the constant "#REM" */
def label = "#REM";
- /** always 0 */
- final val namespaceCode = 0;
-
- /** always empty */
- final def attribute = Node.NoAttributes;
-
- /** always empty */
- final def child = Nil;
-
/** hashcode for this Comment */
override def hashCode() = text.hashCode();
diff --git a/sources/scala/xml/Elem.scala b/sources/scala/xml/Elem.scala
index bf292c8936..074f76d503 100644
--- a/sources/scala/xml/Elem.scala
+++ b/sources/scala/xml/Elem.scala
@@ -14,24 +14,27 @@ import scala.collection.immutable;
/** The case class <code>Elem</code> implements the Node trait,
* providing an immutable data object representing an XML element.
*
- * @param nsCode the namespace code as assigned by NamespaceRegistry
+ * @param namespace the namespace code as assigned by NamespaceRegistry
* @param label the element name
* @param attribute the attribute map
* @param child the children of this node
* @author Burak Emir
*/
-case class Elem( nsCode:Int, label: String, attribute:immutable.Map[String,String], child: Node*) extends Node {
+case class Elem( namespace$$:String, label$$: String, attribute:immutable.Map[String,String], child: Node*) extends Node {
- final override def typeTag$:Int = 0;
+ final val namespaceIntern = namespace$$.intern();
+ final def namespace = namespaceIntern;
+
+ final val labelIntern = label$$.intern();
+ final def label = labelIntern;
- /** the namespace code of this node */
- val namespaceCode: Int = nsCode;
+ final override def typeTag$:Int = 0;
- def this(nsCode:Int, label: String, child: Node*) =
- this(nsCode, label, Node.NoAttributes, child:_*);
+ def this(namespace: String, label: String, child: Node*) =
+ this(namespace, label, Node.NoAttributes, child:_*);
def this(label: String, child: Node*) =
- this(Node.EmptyNamespace.code, label, Node.NoAttributes, child:_*);
+ this(Node.EmptyNamespace, label, Node.NoAttributes, child:_*);
/** Return a new element with updated attributes
*
@@ -46,7 +49,7 @@ case class Elem( nsCode:Int, label: String, attribute:immutable.Map[String,Strin
for ( val p <- attrs ) {
newmap = newmap.update( p._1, p._2 )
}
- Elem(nsCode, label, newmap, child:_*)
+ Elem(namespace, label, newmap, child:_*)
}
/** Return a new symbol with updated attribute
@@ -60,7 +63,7 @@ case class Elem( nsCode:Int, label: String, attribute:immutable.Map[String,Strin
newmap = newmap.update( p._1, p._2 )
}
newmap = newmap.update( attr._1, attr._2 );
- Elem(nsCode, label, newmap, child:_*)
+ Elem(namespace, label, newmap, child:_*)
}
}
diff --git a/sources/scala/xml/EntityRef.scala b/sources/scala/xml/EntityRef.scala
index acfbf3840f..a3de453c30 100644
--- a/sources/scala/xml/EntityRef.scala
+++ b/sources/scala/xml/EntityRef.scala
@@ -16,7 +16,7 @@ import scala.collection.immutable ;
* @param text the text contained in this node
**/
-case class EntityRef( entityName:String ) extends Node {
+case class EntityRef( entityName:String ) extends SpecialNode {
final override def typeTag$:Int = -5;
@@ -24,20 +24,11 @@ case class EntityRef( entityName:String ) extends Node {
*/
def label = "#ENTITY";
- /** always 0 */
- final val namespaceCode = 0;
-
final override def equals(x:Any) = x match {
case EntityRef( s ) => entityName.equals( s );
case _ => false;
}
- /** always empty */
- final def attribute = immutable.TreeMap.Empty[String,String];
-
- /** always empty */
- final def child = Nil;
-
override def hashCode() = entityName.hashCode();
/** returns text, with some characters escaped according to XML spec */
diff --git a/sources/scala/xml/Node.scala b/sources/scala/xml/Node.scala
index 5f74136b53..0c129a314d 100644
--- a/sources/scala/xml/Node.scala
+++ b/sources/scala/xml/Node.scala
@@ -19,7 +19,7 @@ object Node {
immutable.TreeMap.Empty[String,String];
/** the empty namespace */
- val EmptyNamespace: Namespace = new Namespace("");
+ val EmptyNamespace = "";
}
/** Trait for representing XML using nodes of a labelled tree.
@@ -33,8 +33,8 @@ trait Node {
/** QName (the label of this node). I.e. "foo" for &lt;foo/&gt;) */
def label: String;
- /** the namespace code of this node */
- val namespaceCode: Int;
+ /** the namespace of this node */
+ def namespace: String;
/** attribute axis */
def attribute: Map[String,String] ;
@@ -91,7 +91,7 @@ trait Node {
})
}
- override def hashCode() = Utility.hashCode(namespaceCode, label, attribute.toList.hashCode(), child);
+ override def hashCode() = Utility.hashCode(namespace, label, attribute.toList.hashCode(), child);
/** string representation of this node */
override def toString() = Utility.toXML(this);
diff --git a/sources/scala/xml/ProcInstr.scala b/sources/scala/xml/ProcInstr.scala
index 7984e22f7f..e253baaaa4 100644
--- a/sources/scala/xml/ProcInstr.scala
+++ b/sources/scala/xml/ProcInstr.scala
@@ -16,7 +16,7 @@ package scala.xml;
* @param text text contained in this node, may not contain "?>"
**/
-case class ProcInstr( target:String, text:Option[String] ) extends Node {
+case class ProcInstr( target:String, text:Option[String] ) extends SpecialNode {
final override def typeTag$:Int = -2;
@@ -41,15 +41,6 @@ case class ProcInstr( target:String, text:Option[String] ) extends Node {
/** the constant "#PI" */
final def label = "#PI";
- /** always 0 */
- final val namespaceCode = 0;
-
- /** always empty */
- final def attribute = Node.NoAttributes;
-
- /** always empty */
- final def child = Nil;
-
/** hashcode for this PI */
override def hashCode() = target.hashCode() * 7 + text.hashCode();
diff --git a/sources/scala/xml/Text.scala b/sources/scala/xml/Text.scala
index 489ad031f6..a65c75b60f 100644
--- a/sources/scala/xml/Text.scala
+++ b/sources/scala/xml/Text.scala
@@ -16,7 +16,7 @@ import scala.collection.immutable ;
* @param text the text contained in this node
**/
-case class Text( text:String ) extends Node {
+case class Text( text:String ) extends SpecialNode {
final override def typeTag$:Int = -1;
@@ -24,21 +24,12 @@ case class Text( text:String ) extends Node {
*/
def label = "#PCDATA";
- /** always 0 */
- final val namespaceCode = 0;
-
final override def equals(x:Any) = x match {
case s:String => text.equals( s );
case Text( s ) => text.equals( s );
case _ => false;
}
- /** always empty */
- final def attribute = immutable.TreeMap.Empty[String,String];
-
- /** always empty */
- final def child = Nil;
-
/** hashcode for this Text */
override def hashCode() = text.hashCode();
diff --git a/sources/scala/xml/Utility.scala b/sources/scala/xml/Utility.scala
index e7216fe46f..17555941d5 100644
--- a/sources/scala/xml/Utility.scala
+++ b/sources/scala/xml/Utility.scala
@@ -100,13 +100,13 @@ object Utility {
}
/** returns a hashcode for the given constituents of a node */
- def hashCode(uriCode:int, label:String, attribHashCode:int, children:Seq[Node]) = {
- 41 * uriCode % 7 + label.hashCode() + attribHashCode + children.hashCode()
+ def hashCode(uri:String, label:String, attribHashCode:int, children:Seq[Node]) = {
+ 41 * uri.hashCode() % 7 + label.hashCode() + attribHashCode + children.hashCode()
}
/** returns a hashcode for the given constituents of a node */
- def hashCode(uriCode:int, label:String, attribs:scala.collection.mutable.HashMap[String,String], children:Seq[Node]) = {
- 41 * uriCode % 7 + label.hashCode() + attribs.toList.hashCode() + children.hashCode()
+ def hashCode(uri:String, label:String, attribs:scala.collection.mutable.HashMap[String,String], children:Seq[Node]) = {
+ 41 * uri.hashCode() % 7 + label.hashCode() + attribs.toList.hashCode() + children.hashCode()
}
def systemLiteralToString( s:String ) = {
diff --git a/sources/scala/xml/nobinding/NoBindingFactoryAdapter.scala b/sources/scala/xml/nobinding/NoBindingFactoryAdapter.scala
index 88456ec026..cc5077ab1a 100644
--- a/sources/scala/xml/nobinding/NoBindingFactoryAdapter.scala
+++ b/sources/scala/xml/nobinding/NoBindingFactoryAdapter.scala
@@ -35,8 +35,8 @@ class NoBindingFactoryAdapter extends FactoryAdapter {
attrs: mutable.HashMap[String,String],
children: List[Node] ):Elem = {
- val ncode = NamespaceRegistry.getCode( uri );
- val elHashCode = Utility.hashCode( ncode, label, attrs, children ) ;
+ val uri$ = uri.intern();
+ val elHashCode = Utility.hashCode( uri$, label, attrs, children ) ;
val attrMap = immutable.TreeMap.Empty[String,String] incl attrs;
cache.get( elHashCode ).match{
@@ -44,7 +44,7 @@ class NoBindingFactoryAdapter extends FactoryAdapter {
//System.err.println("[using cached elem +"+cachedElem.toXML+"!]"); //DEBUG
cachedElem
case None =>
- val el = Elem( ncode, label, attrMap, children:_* );
+ val el = Elem( uri$, label, attrMap, children:_* );
cache.update( elHashCode, el );
el
}
diff --git a/test/files/jvm/xmlLiterals.scala b/test/files/jvm/xmlLiterals.scala
index 6db3f3d823..d908a49349 100644
--- a/test/files/jvm/xmlLiterals.scala
+++ b/test/files/jvm/xmlLiterals.scala
@@ -49,10 +49,10 @@ object Test {
val x3 = xx3.toString(); /* ws in element content */
assertEquals( noWS( x3 ),
- Elem(0,"hello",e,
- Elem(0,"world",e),
- Elem(0,"test",e),
- Elem(0,"mars",e)).toString() );
+ Elem("","hello",e,
+ Elem("","world",e),
+ Elem("","test",e),
+ Elem("","mars",e)).toString() );
Console.println("ws trimming in patterns");
@@ -72,11 +72,11 @@ object Test {
</html>.toString();
assertEquals( noWS( z ), noWS(
- Elem(0,"html",e,
- Elem(0,"body",e,
- Elem(0,"h1",e,Text("Hello World")),
- Elem(0,"p",e,Text("Check the "),
- Elem(0,"a", e,Text("scala"))
+ Elem("","html",e,
+ Elem("","body",e,
+ Elem("","h1",e,Text("Hello World")),
+ Elem("","p",e,Text("Check the "),
+ Elem("","a", e,Text("scala"))
% Pair("href","scala.epfl.ch"),
Text("page!"))
) % Pair("background","#FFFFFF")
@@ -100,16 +100,16 @@ object Test {
/* === embedded Scala blocks === */
def computeDate() = {
- Elem(0,"date", e, Text("now!"));
+ Elem("","date", e, Text("now!"));
}
/* embedding Scala strings as text and elements */
val sc = <hello>{ "World" }{ Text("42") }{ computeDate() }</hello>;
assertEquals( sc.child.elements.toList,
- List( Text("World"), Text("42"), Elem(0, "date", e,Text("now!") ) ) );
+ List( Text("World"), Text("42"), Elem("", "date", e,Text("now!") ) ) );
assertEquals( sc.toString(),
- Elem(0,"hello",e,Text("World42"),Elem(0,"date",e,Text("now!"))).toString() );
+ Elem("","hello",e,Text("World42"),Elem("","date",e,Text("now!"))).toString() );
def foo( m:Node ):String = m match {
case <hello/> => "hello node"
@@ -132,11 +132,11 @@ object Test {
</tr>;
assertEquals( noWS( rows.toList.toString() ),
- noWS( List(Elem(0,"tr",e,
- Elem(0,"td",e,Text("1.1")),Elem(0,"td",e,Text("1.2"))
+ noWS( List(Elem("","tr",e,
+ Elem("","td",e,Text("1.1")),Elem("","td",e,Text("1.2"))
),
- Elem(0,"tr",e,
- Elem(0,"td",e,Text("2.1")),Elem(0,"td",e,Text("2.2"))
+ Elem("","tr",e,
+ Elem("","td",e,Text("2.1")),Elem("","td",e,Text("2.2"))
)
).toString() )
);
@@ -144,9 +144,9 @@ object Test {
val rows3 = <tr> a <!-- an XML comment --> b <?pinotext?> c <?pi text?> d </tr>;
// these are not equal as comments are valid XML Info items.
- assertEquals( rows2, Elem(0,"tr",e,Comment(" an XML comment "),ProcInstr("pinotext",None),ProcInstr("pi",Some("text"))));
+ assertEquals( rows2, Elem("","tr",e,Comment(" an XML comment "),ProcInstr("pinotext",None),ProcInstr("pi",Some("text"))));
- assertEquals( rows3, Elem(0,"tr",e,Text("a"),Comment(" an XML comment "),Text("b"),ProcInstr("pinotext",None),Text("c"),ProcInstr("pi",Some("text")),Text("d")));
+ assertEquals( rows3, Elem("","tr",e,Text("a"),Comment(" an XML comment "),Text("b"),ProcInstr("pinotext",None),Text("c"),ProcInstr("pi",Some("text")),Text("d")));
}
@@ -192,8 +192,8 @@ object Test03Servlet {
case <table>{ xs @ _* }</table> =>
<table align="center">{ beautify( xs )}</table>
- case Elem(0, label, _, xs @ _* ) =>
- new Elem(0, label, beautify( xs ):_*)
+ case Elem("", label, _, xs @ _* ) =>
+ new Elem("", label, beautify( xs ):_*)
case _ => n
}
@@ -247,14 +247,14 @@ object Test03Servlet {
Console.println( onlyOne );
val tryBrace = <try>Now escaped {{ braces } </try>;
- assertEquals( tryBrace, Elem(0,"try",e,Text("Now escaped { braces }")));
+ assertEquals( tryBrace, Elem("","try",e,Text("Now escaped { braces }")));
val tryBrace2 = <try myAttrib={(3+4).toString() }> cool ?</try>;
assertEquals( tryBrace2.attribute("myAttrib"), "7" );
/* Scala comments are not allowed in XML literals. see neg(2) */
val zzz = <hello>/* no comment */</hello>;
- assertEquals( zzz, Elem(0,"hello", e, Text("/* no comment */")));
+ assertEquals( zzz, Elem("","hello", e, Text("/* no comment */")));
}
diff --git a/test/files/jvm/xmlstuff.scala b/test/files/jvm/xmlstuff.scala
index bf08aa348e..2617110372 100644
--- a/test/files/jvm/xmlstuff.scala
+++ b/test/files/jvm/xmlstuff.scala
@@ -28,8 +28,8 @@ object Test with Application {
val c = new Node {
def label = "hello";
- val namespaceCode = 0;
- def child = List(Elem(0,"world",e));
+ def namespace = "";
+ def child = List(Elem("","world",e));
def attribute = e;
};
@@ -46,10 +46,10 @@ object Test with Application {
val i = new InputSource( new StringReader( x2 ));
val x2p = XML.load( i );
- assertEquals(x2p, Elem(0,"book",e,
- Elem(0,"author",e,Text("Peter Buneman")),
- Elem(0,"author",e,Text("Dan Suciu")),
- Elem(0,"title",e,Text("Data on ze web"))));
+ assertEquals(x2p, Elem("","book",e,
+ Elem("","author",e,Text("Peter Buneman")),
+ Elem("","author",e,Text("Dan Suciu")),
+ Elem("","title",e,Text("Data on ze web"))));
val xmlFile2 = "<bib><book><author>Peter Buneman</author><author>Dan Suciu</author><title>Data on ze web</title></book><book><author>John Mitchell</author><title>Foundations of Programming Languages</title></book></bib>";
val isrc2 = new InputSource( new StringReader( xmlFile2 ) );
@@ -59,9 +59,9 @@ object Test with Application {
Console.println("xpath \\");
- assertSameElements( parsedxml1 \ "_" , List( Elem(0,"world",e) ) );
+ assertSameElements( parsedxml1 \ "_" , List( Elem("","world",e) ) );
- assertSameElements( parsedxml1 \ "world", List( Elem(0,"world",e) ) );
+ assertSameElements( parsedxml1 \ "world", List( Elem("","world",e) ) );
/*
Console.println( parsedxml2 \ "_" );
@@ -74,13 +74,13 @@ object Test with Application {
parsedxml2 \ "_" ,
List(
- Elem(0,"book", e,
- Elem(0,"author",e,Text("Peter Buneman")),
- Elem(0,"author",e,Text("Dan Suciu")),
- Elem(0,"title",e,Text("Data on ze web"))),
- Elem(0,"book",e,
- Elem(0,"author",e,Text("John Mitchell")),
- Elem(0,"title",e,Text("Foundations of Programming Languages"))))
+ Elem("","book", e,
+ Elem("","author",e,Text("Peter Buneman")),
+ Elem("","author",e,Text("Dan Suciu")),
+ Elem("","title",e,Text("Data on ze web"))),
+ Elem("","book",e,
+ Elem("","author",e,Text("John Mitchell")),
+ Elem("","title",e,Text("Foundations of Programming Languages"))))
);
assertEquals( (parsedxml2 \ "author").length, 0 );
@@ -88,13 +88,13 @@ object Test with Application {
parsedxml2 \ "book",
List(
- Elem(0,"book",e,
- Elem(0,"author",e,Text("Peter Buneman")),
- Elem(0,"author",e,Text("Dan Suciu")),
- Elem(0,"title",e,Text("Data on ze web"))),
- Elem(0,"book",e,
- Elem(0,"author",e,Text("John Mitchell")),
- Elem(0,"title",e,Text("Foundations of Programming Languages")))
+ Elem("","book",e,
+ Elem("","author",e,Text("Peter Buneman")),
+ Elem("","author",e,Text("Dan Suciu")),
+ Elem("","title",e,Text("Data on ze web"))),
+ Elem("","book",e,
+ Elem("","author",e,Text("John Mitchell")),
+ Elem("","title",e,Text("Foundations of Programming Languages")))
)
);
@@ -103,11 +103,11 @@ object Test with Application {
parsedxml2 \ "_" \ "_",
List(
- Elem(0,"author",e,Text("Peter Buneman")),
- Elem(0,"author",e,Text("Dan Suciu")),
- Elem(0,"title",e,Text("Data on ze web")),
- Elem(0,"author",e,Text("John Mitchell")),
- Elem(0,"title",e,Text("Foundations of Programming Languages"))
+ Elem("","author",e,Text("Peter Buneman")),
+ Elem("","author",e,Text("Dan Suciu")),
+ Elem("","title",e,Text("Data on ze web")),
+ Elem("","author",e,Text("John Mitchell")),
+ Elem("","title",e,Text("Foundations of Programming Languages"))
)
);
@@ -116,9 +116,9 @@ object Test with Application {
parsedxml2 \ "_" \ "author",
List(
- Elem(0,"author",e,Text("Peter Buneman")),
- Elem(0,"author",e,Text("Dan Suciu")),
- Elem(0,"author",e,Text("John Mitchell"))
+ Elem("","author",e,Text("Peter Buneman")),
+ Elem("","author",e,Text("Dan Suciu")),
+ Elem("","author",e,Text("John Mitchell"))
)
);
@@ -132,9 +132,9 @@ object Test with Application {
parsedxml2 \\ "author",
List(
- Elem(0,"author",e,Text("Peter Buneman")),
- Elem(0,"author",e,Text("Dan Suciu")),
- Elem(0,"author",e,Text("John Mitchell"))
+ Elem("","author",e,Text("Peter Buneman")),
+ Elem("","author",e,Text("Dan Suciu")),
+ Elem("","author",e,Text("John Mitchell"))
)
);
@@ -144,30 +144,30 @@ object Test with Application {
new NodeSeq(List( parsedxml2 )) \\ "_",
List(
- Elem(0,"bib",e,
- Elem(0,"book",e,
- Elem(0,"author",e,Text("Peter Buneman")),
- Elem(0,"author",e,Text("Dan Suciu")),
- Elem(0,"title",e,Text("Data on ze web"))),
- Elem(0,"book",e,
- Elem(0,"author",e,Text("John Mitchell")),
- Elem(0,"title",e,Text("Foundations of Programming Languages")))),
- Elem(0,"book",e,
- Elem(0,"author",e,Text("Peter Buneman")),
- Elem(0,"author",e,Text("Dan Suciu")),
- Elem(0,"title",e,Text("Data on ze web"))),
- Elem(0,"author",e,Text("Peter Buneman")),
+ Elem("","bib",e,
+ Elem("","book",e,
+ Elem("","author",e,Text("Peter Buneman")),
+ Elem("","author",e,Text("Dan Suciu")),
+ Elem("","title",e,Text("Data on ze web"))),
+ Elem("","book",e,
+ Elem("","author",e,Text("John Mitchell")),
+ Elem("","title",e,Text("Foundations of Programming Languages")))),
+ Elem("","book",e,
+ Elem("","author",e,Text("Peter Buneman")),
+ Elem("","author",e,Text("Dan Suciu")),
+ Elem("","title",e,Text("Data on ze web"))),
+ Elem("","author",e,Text("Peter Buneman")),
Text("Peter Buneman"),
- Elem(0,"author",e,Text("Dan Suciu")),
+ Elem("","author",e,Text("Dan Suciu")),
Text("Dan Suciu"),
- Elem(0,"title",e,Text("Data on ze web")),
+ Elem("","title",e,Text("Data on ze web")),
Text("Data on ze web"),
- Elem(0,"book",e,
- Elem(0,"author",e,Text("John Mitchell")),
- Elem(0,"title",e,Text("Foundations of Programming Languages"))),
- Elem(0,"author",e,Text("John Mitchell")),
+ Elem("","book",e,
+ Elem("","author",e,Text("John Mitchell")),
+ Elem("","title",e,Text("Foundations of Programming Languages"))),
+ Elem("","author",e,Text("John Mitchell")),
Text("John Mitchell"),
- Elem(0,"title",e,Text("Foundations of Programming Languages")),
+ Elem("","title",e,Text("Foundations of Programming Languages")),
Text("Foundations of Programming Languages")
)
);
@@ -178,8 +178,8 @@ object Test with Application {
parsedxml2 \\ "title",
List(
- Elem(0,"title",e,Text("Data on ze web")),
- Elem(0,"title",e,Text("Foundations of Programming Languages")))
+ Elem("","title",e,Text("Data on ze web")),
+ Elem("","title",e,Text("Foundations of Programming Languages")))
);