Fork me on GitHub

By choosing a specific conversion strategy. You could do just that in clojure with the aforementioned libraries if you like.


It’s also worth bearing in mind that JSON / EDN / Clojure data structures are very, very similar (asides from richer types in EDN / Clojure — but their structure is very similar). That is not true for XML. The JSON-java library just happens to pick an (opinionated) option for you that you can’t control. Great if you like its choice — sucks if you don’t. The various XML parsing libraries in Clojure all produce different structures and some of them provide a degree of control over what that structure is. So reading XML -> Clojure data structures gives you the most freedom and the most choice (and then Clojure to JSON is "trivial" and near 1:1). @josh_tackett /cc @donaldball


Hi, I don't know if this place is right place to ask this question. So, my question, are there any Clojure function that doesn't work on ClojureScript function??


Probably the concurrency stuff? pmap, agent…? I’d have to go digging in the docs.


cljs.user=> (map inc [1 2 3 4])
(2 3 4 5)
cljs.user=> (pmap inc [1 2 3 4])
ERROR - undefined is not an object (evaluating '')
cljs.user=> (def q (agent nil))
ERROR - undefined is not an object (evaluating '')


@seancorfield The data structure that produces is completely unusable...


its a complete mess


@josh_tackett the mess is inherent to XML (which is partly why people have been moving away from XML to JSON), you can't really blame for that IMO


@val_waeselynck The question remains, what is the best way to parse it then? because is no the way to do it


why not? Sure, you have to do some post-processing afterwards, but Clojure really isn't the worst language to use to transform data structures


note that you can use things like to traverse the data structure


@val_waeselynck the data structure that is returned is soooooo deeply nested that it is very difficult to traverse


Some find spectre useful for working with deeply nested data structures


@josh_tackett the format is the most suitable representation for processing you'll find I think. The alternative is hiccup syntax, which is great for writing but terrible for processing


have you looked at enlive? it lets you manipulate html/xml using CSS like selectors


@plexus Its ok I just put in the hours and destructured it