From d6963262b4a68577925b1281d246e30e3265e97a Mon Sep 17 00:00:00 2001 From: buraq Date: Mon, 9 Feb 2004 18:07:31 +0000 Subject: projections on XML ! preserving document order ! --- test/files/run/xmlstuff.check | 8 +++++++- test/files/run/xmlstuff.scala | 8 ++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) (limited to 'test/files/run') diff --git a/test/files/run/xmlstuff.check b/test/files/run/xmlstuff.check index af85d96257..4636a6f8b4 100644 --- a/test/files/run/xmlstuff.check +++ b/test/files/run/xmlstuff.check @@ -20,4 +20,10 @@ parsedxml2/'_/'_/'author NodeList() parsedxml2/#'author -NodeList('author(Text(Dan Suciu)),'author(Text(Peter Buneman)),'author(Text(John Mitchell))) +NodeList('author(Text(Peter Buneman)),'author(Text(Dan Suciu)),'author(Text(John Mitchell))) + +new NodeList(List(parsedxml2))/#'_ +NodeList('book('author(Text(Peter Buneman)),'author(Text(Dan Suciu)),'title(Text(Data on ze web))),'author(Text(Peter Buneman)),Text(Peter Buneman),'author(Text(Dan Suciu)),Text(Dan Suciu),'title(Text(Data on ze web)),Text(Data on ze web),'book('author(Text(John Mitchell)),'title(Text(Foundations of Programming Languages))),'author(Text(John Mitchell)),Text(John Mitchell),'title(Text(Foundations of Programming Languages)),Text(Foundations of Programming Languages)) + +new NodeList(List(parsedxml2))/#'title +NodeList('title(Text(Data on ze web)),'title(Text(Foundations of Programming Languages))) diff --git a/test/files/run/xmlstuff.scala b/test/files/run/xmlstuff.scala index 916798e112..28f753ce90 100644 --- a/test/files/run/xmlstuff.scala +++ b/test/files/run/xmlstuff.scala @@ -2,6 +2,7 @@ import java.io.StringReader; import org.xml.sax.InputSource; import scala.xml.nobinding.XML; import scala.testing.UnitTest.assertEquals ; +import scala.xml.NodeList; object Test with Application { val xmlFile1 = ""; @@ -39,4 +40,11 @@ object Test with Application { Console.println( "\nparsedxml2/#'author"); Console.println( parsedxml2/#'author ); + Console.println( "\nnew NodeList(List(parsedxml2))/#'_"); + Console.println( new NodeList( List( parsedxml2 ))/#'_ ); + + Console.println( "\nnew NodeList(List(parsedxml2))/#'title"); + Console.println( new NodeList( List( parsedxml2 ))/#'title ); + + } -- cgit v1.2.3