JQuery as a selector in Haskell

I am processing server side html processing in Haskell. Wonder if there is an equivalent jquery type selector engine implemetation for haskell that I could use. Google does not give anything.

+7
jquery haskell
source share
5 answers
+5
source share

How the jQuery selector mechanism works (approximately), the existing Javascript DOM-selection / manipulation code is used. As far as I know, no one has created something similar in Haskell and probably not without reason. This is easy to do with Javascript because of the DOM and existing functionality, but in Haskell you have neither much need nor for it to be especially easy.

However, if you write it yourself, you will simply do a lot of nasty XML parsing. If you can put away the page in XHTML, you can parse it as XML; then you can choose based on if the node has children, if the node has this attribute, what the element itself is, and so on.

Maybe you're just looking for an XML library! If this works for you, I would recommend HaXml. I used it two more times, but I liked it. However, nothing special in this application.

+2
source share

Take a look at the Xtract module from HaXml. There is a command line tool with the same name.

+1
source share

I made a dom-selector package that supports some css selectors. This works in xml-conduit and html-conduit packages. I expect that the xml channel and html channel will be actively developed as they accompany Yesod, the main web server structure for Haskell.

+1
source share

I am writing a module to do just that: HandsomeSoup . He uses HXT . I also wrote a complete guide to working with HTML with HXT here .

0
source share

All Articles