HXQ-0.8.5.1: A Compiler from XQuery to HaskellContentsIndex
Text.XML.HXQ.XQuery
Contents
The XML Data Representation
The XQuery Compiler
The XQuery Interpreter
The XQuery Compiler with Database Connectivity
The XQuery Interpreter with Database Connectivity
Shredding and Publishing XML Documents Using a Relational Database
Description
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 and database connectivity using HDBC. For more information, look at http://lambda.uta.edu/HXQ/.
Synopsis
data XTree
= XElem !Tag !AttList !Int XTree [XTree]
| XText !String
| XInt !Int
| XFloat !Float
| XBool !Bool
| XPI Tag String
| XGERef Tag
| XComment String
| XError String
| XStmt Statement
| XNoPad
type XSeq = [XTree]
type Tag = String
type AttList = [(Name, String)]
putXSeq :: XSeq -> IO ()
xq :: String -> Q Exp
xe :: String -> Q Exp
xquery :: String -> IO XSeq
xfile :: String -> IO XSeq
xqdb :: String -> Q Exp
connect :: FilePath -> IO Connection
prepareSQL :: IConnection conn => conn -> String -> IO Statement
executeSQL :: Statement -> XSeq -> IO XSeq
xqueryDB :: IConnection conn => String -> conn -> IO XSeq
xfileDB :: IConnection conn => String -> conn -> IO XSeq
shred :: IConnection conn => conn -> String -> String -> IO ()
createIndex :: IConnection conn => conn -> String -> String -> IO ()
The XML Data Representation
data XTree
Rose tree representation of XML data. The Int in XElem is the preorder numbering used for the document order of nodes.
Constructors
XElem !Tag !AttList !Int XTree [XTree]an XML tree node (element)
XText !Stringan XML tree leaf (PCDATA)
XInt !Intan XML tree leaf (int)
XFloat !Floatan XML tree leaf (float)
XBool !Boolan XML tree leaf (boolean)
XPI Tag Stringprocessing instruction
XGERef Taggeneral entity reference
XComment Stringcomment
XError Stringerror report
XStmt Statementused internally to wrap an SQL statement
XNoPadmarker for no padding in XSeq
show/hide Instances
type XSeq = [XTree]
type Tag = String
type AttList = [(Name, String)]
putXSeq :: XSeq -> IO ()
Print the XQuery result (which is a sequence of XML fragments) without buffering.
The XQuery Compiler
xq :: String -> Q Exp
Run an XQuery that reads XML documents. When evaluated, it returns IO XSeq.
xe :: String -> Q Exp
Run an XQuery expression that does not read XML documents. When evaluated, it returns XSeq.
The XQuery Interpreter
xquery :: String -> IO XSeq
Evaluate the XQuery using the interpreter.
xfile :: String -> IO XSeq
Read an XQuery from a file and run it using the interpreter.
The XQuery Compiler with Database Connectivity
xqdb :: String -> Q Exp
Run an XQuery that reads XML documents and queries databases. When evaluated, it returns (IConnection conn) => conn -> IO XSeq.
connect :: FilePath -> IO Connection
Connect to the relational database in filepath using the HDBC Sqlite3 driver
prepareSQL :: IConnection conn => conn -> String -> IO Statement
executeSQL :: Statement -> XSeq -> IO XSeq
The XQuery Interpreter with Database Connectivity
xqueryDB :: IConnection conn => String -> conn -> IO XSeq
Evaluate the XQuery with database connectivity using the interpreter.
xfileDB :: IConnection conn => String -> conn -> IO XSeq
Read an XQuery with database connectivity from a file and run it using the interpreter.
Shredding and Publishing XML Documents Using a Relational Database
shred :: IConnection conn => conn -> String -> String -> IO ()
Store an XML document into the database under the given name.
createIndex :: IConnection conn => conn -> String -> String -> IO ()
Create a secondary index on tagname for the shredded document under the given name..
Produced by Haddock version 2.1.0