{--------------------------------------------------------------
-
- Testing the XQuery compiler on a large file
- Download dblp.xml from http://dblp.uni-trier.de/xml/
- Programmer: Leonidas Fegaras (fegaras@cse.uta.edu)
- Date: 03/30/2008
-
---------------------------------------------------------------}
{-# OPTIONS_GHC -fth #-}
module Main where
import XML.HXQ.XQuery
f(x,y) = $(xe "{$x,', ',$y}")
main = do a <- $(xq ("{ "
++" for $x at $i in doc('data/dblp.xml')//inproceedings "
++" where $x/author = 'Leonidas Fegaras' "
++" order by $x/year descending "
++" return { $i, ') ', $x/booktitle/text(), "
++" ': ', $x/title/text() "
++" } "
++" } "))
putXSeq a
b <- $(xq "f($a/paper[10],$a/paper[8])")
putXSeq b