Re:Crystal in Production: Diploid
by wiremine on Saturday October 28, 2017 @11:54AM
(#15575522)
Would love to hear your take on the good and bad parts of Crystal. Been toying around with it for a few small things, and been following the blog... would love to hear more input from users. :-)
[ Parent
| on HN ]
Would love to have a nokogiri-level xpath or css3 selector capabilities. I'm up to my neck with projects, but this looks like a good start: https://github.com/jgehring/hcxselect/tree/83d3edaa8a6944d20...
We have libxml2 bound in the stdlib with xpath support, do you need more?
Yes! it would take a lot of hard work to convert all my css3 selectors to xpath.
I think having css3 to xpath selector conversion in the stdlib (or perhaps a shard based on how complex it is)would be possible. It would be great if you could open an issue in crystal's repo.
Re:Crystal in Production: Diploid
by ricardobeat on Saturday October 28, 2017 @03:41PM
(#15576468)
This shard implements a CSS selector API on top of an html parser: https://github.com/kostya/modest
If only it was compatible with the existing XML interface...
Re:Crystal in Production: Diploid
by ricardobeat on Sunday October 29, 2017 @08:31AM
(#15579061)
XML has way more surface area than HTML, you could only query a small subset of valid XML documents with CSS. Plus, these days nobody uses XML parsers for HTML anymore, their behavior has diverged; things like behaviour of unclosed elements, valid children tags, are defined in the HTML spec and not possible in XML.