]> gitweb @ CieloNegro.org - hxt-compile.git/blobdiff - Main.hs
Succeeded to compile examples/tiny.xml
[hxt-compile.git] / Main.hs
diff --git a/Main.hs b/Main.hs
index d82a4bd93b7e75a6ff9845150450ae0709b93086..8466f76542ed536646388fa60c09700d69ca8bdc 100644 (file)
--- a/Main.hs
+++ b/Main.hs
@@ -1,4 +1,30 @@
 module Main where
 
+import           Language.Haskell.Pretty
+import           Language.Haskell.Syntax
+import           Text.XML.HXT.Compilation
+import           Text.XML.HXT.Arrow
+import qualified System.IO.UTF8 as Uio
+
+
 main :: IO ()
-main = return ()
+main = do let fpath = "examples/tiny.xml"
+
+          [hsMod] <- runX ( setErrorMsgHandler False fail
+                            >>>
+                            constA fpath
+                            >>>
+                            readFromDocument [ (a_validate        , v_0)
+                                             , (a_check_namespaces, v_1)
+                                             ]
+                            >>>
+                            ( constA (Module "Foo")
+                              &&&
+                              constA (HsIdent "foo")
+                              &&&
+                              compileDocument
+                            )
+                            >>>
+                            wrapIntoModule
+                          )
+          Uio.putStrLn (prettyPrint hsMod)