HXQ is a fast and space-efficient compiler from XQuery (the standard query language for XML) to embedded Haskell code. The translation is based on Haskell templates. It also provides an interpreter for evaluating ad-hoc XQueries read from input or from files. For more information, look at http://lambda.uta.edu/HXQ/.
The XML Data Representation
Rose tree representation of XML data. The Int in XElem is the preorder numbering used for the document order of nodes.
XElem !Tag !AttList !Int [XTree] | an XML tree node (element) |
XText !String | an XML tree leaf (PCDATA) |
XInt !Int | an XML tree leaf (int) |
XFloat !Float | an XML tree leaf (float) |
XBool !Bool | an XML tree leaf (boolean) |
XPI Tag String | processing instruction |
XGERef Tag | general entity reference |
XComment String | comment |
XError String | error report |
putXSeq :: XSeq -> IO ()Source
Print the XQuery result (which is a sequence of XML fragments) with no waiting
The XQuery Compiler
Run an XQuery that reads XML documents. When evaluated, it returns IO XSeq.
Run an XQuery expression that does not read XML documents. When evaluated, it returns XSeq.