dtd.xml
[hxt-compile.git] / Main.hs
1 module Main where
2
3 import           Language.Haskell.Pretty
4 import           Language.Haskell.Syntax
5 import           Text.XML.HXT.Compilation
6 import           Text.XML.HXT.Arrow
7 import qualified System.IO.UTF8 as Uio
8
9
10 main :: IO ()
11 main = do let fpath = "examples/dtd.xml"
12
13           [hsMod] <- runX ( setErrorMsgHandler False fail
14                             >>>
15                             constA fpath
16                             >>>
17                             readFromDocument [ (a_validate        , v_0)
18                                              , (a_canonicalize    , v_0)
19                                              , (a_check_namespaces, v_1)
20                                              ]
21                             >>>
22                             ( constA (Module "Foo")
23                               &&&
24                               constA []
25                               &&&
26                               constA (HsIdent "foo")
27                               &&&
28                               compileDocument
29                             )
30                             >>>
31                             wrapIntoModule
32                           )
33           Uio.putStrLn (prettyPrint hsMod)