This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-21
Channels
- # adventofcode (20)
- # babashka (118)
- # beginners (170)
- # calva (1)
- # clojure (102)
- # clojure-europe (1)
- # clojure-nl (13)
- # clojure-uk (5)
- # clojuredesign-podcast (19)
- # code-reviews (10)
- # core-async (9)
- # cursive (7)
- # datomic (8)
- # fulcro (3)
- # malli (5)
- # mount (1)
- # off-topic (19)
- # overtone (1)
- # reagent (2)
- # reitit (2)
- # spacemacs (2)
- # sql (4)
- # tools-deps (5)
ad hoc: what is the preferred way to consume xml into Clojurescript? (while waiting for “XML! XML! XML!” 😁 )
And for reading xml in cljs, I haven't had to do that myself, but I'd probably start with https://github.com/funcool/tubax, looks promising.
Specter and similar tools can help if you need to query and/or transform the XML after you read it in https://github.com/redplanetlabs/specter
For something a bit lighter than Specter: https://vvvvalvalval.github.io/supdate/
Tubax worked great for me locally but didn't survive deployment. Tried using sax-js directly and also gave up. Then I found "node-xml-lite", which partially works (couldn't read a file, but can pass it a string at least). But wait... there's a cljs port of clojure.data.xml, so what's the problem? Dunno, but that didn't work for me either. Perhaps I'm missing something really silly. Gonna try this next: https://google.github.io/closure-library/api/goog.dom.xml.html
Like clojure/data/xml.cljs, it uses the browser object's DOMParser
.
There's an open issue about it not compiling with shadow-cljs, with instructions kindly given to fix it, but I tried it without luck
Thanks for the inspiration! My favorite part of working with XML is making it not-XML
Yes, I've been wanting to find some excuse to use that for awhile...