Is it possible to use Text or ByteString on HXT in Haskell?
Asked Answered
H

1

8

I think HXT, a XML/HTML processing library in Haskell, has really flexible and powerful methods for traversing and manipulating DOM trees by Arrows. http://adit.io/posts/2012-04-14-working_with_HTML_in_haskell.html

It seems, however, HXT has only String representation for DOM node contents. http://hackage.haskell.org/packages/archive/hxt/9.1.6/doc/html/Text-XML-HXT-DOM-TypeDefs.html#t:XNode

Is it possible to use either of ByteString or Text for HXT? Text is preferred since I am using HXT with Yesod, which seems to mainly use Text.

Homerus answered 8/7, 2012 at 9:51 Comment(1)
I opened an issue for this on github -Poore
F
6

Neither HXT nor HaXml appear to support either bytestring or text, but if you are working with Yesod you should probably use xml-conduit and html-conduit anyway.

Furious answered 8/7, 2012 at 13:55 Comment(1)
Thank you for your comment. I tried xml-conduit and html-conduit, and they worked pretty nice with ByteString. I also made dom-selector package, which works on those two packages, to make it possible to traverse a DOM tree by css selectors.Homerus

© 2022 - 2024 — McMap. All rights reserved.