-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLNB.hs
37 lines (32 loc) · 1.04 KB
/
LNB.hs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import System.IO
import System.Exit
import Text.XML.HXT.Core
import Text.XML.HXT.Curl
testfolder = "/Users/pet/Documents/p_001_cina1986n001/"
testfile = "cina1986n001_mets.xml"
processLNB_mets h = do
contents <- hGetContents h
putStr . unlines . (take 4) . lines $ contents
--main = do
-- withFile (testfolder ++ testfile) ReadMode processLNB_mets
main :: IO ()
main
= do
[rc] <- runX
( configSysVars [ withValidate no
, withCurl []
]
>>>
readDocument []
"http://eksperimenti.ailab.lv/kamols/?analizet=meitenes"
>>>
writeDocument [ withOutputEncoding isoLatin1
]
"" -- output to stdout
>>>
getErrStatus
)
exitWith ( if rc >= c_err
then ExitFailure 1
else ExitSuccess
)