我是Haskell的初学者。我有一些使用xml-conduit的代码,它们都工作得很好,我可以按我想要的方式对其进行转换。
let src_file = "blah.xhtml"
Document prologue root epilogue <- readFile def{psDecodeEntities=decodeHtmlEntities} src_file
let root' = transform root
-- And now we write out. Let's indent our output
writeFile def
{ rsPretty = True
} "output.xhtml" $ Document prologue root' epilogue我的问题是我的输入来自html (来自web)。我想把它输入到我的函数中。目前,我必须运行命令行实用程序'tidy‘将其规范化为XHTML:
tidy -output blah.xhtml -asxhtml blah.html这是有效的,但显然不是理想的。我不想写一个围绕“整洁”的命令行包装,我确信这个问题肯定已经解决了!我找到了html-conduit包,但不知道如何将它们连接起来。如果有人能告诉我如何做这件事,或者另一个能做我想做的事情的库,我将不胜感激。我尝试阅读html-conduit的文档,但无法弄清楚这两个库是如何互操作的。
发布于 2015-09-10 16:13:45
您应该能够从html-conduit使用readFile函数。您在尝试集成这两个库时遇到了什么问题?
https://stackoverflow.com/questions/32486990
复制相似问题