ClojureScript support

Description

Parsing XML(and HTML) is very often task and currently it requires a lot of effort and use of different libraries and wrappers around JS libs.

We can dramatically simplify it if we migrate data.xml to ClojureScript.

I'm maintaining koh library which has proof-of-concept XML support for Node and Browsers https://github.com/artemyarulin/koh/blob/master/src/koh/xml.cljs

The general idea is that we can utilise DOMParser object in order to parse string to XML tree. It has a decent browser support https://developer.mozilla.org/en-US/docs/Web/API/DOMParser and has a NodeJS implementation which follows the same API https://github.com/jindw/xmldom

What do you think about this feature?
I can pretty much follow the same guidelines from http://dev.clojure.org/jira/browse/DZIP-5 and implement it in the same way

Thanks

Environment

None

Activity

Show:

Herwig HochleitnerDecember 8, 2016 at 3:48 AM

will be released as part of 0.2.0-alpha1

Herwig HochleitnerAugust 8, 2016 at 7:37 PM

Thanks for the offer! In fact, the clojurescript support is in a testable state right now and I'm utilizing it for a cljs webdav library: https://github.com/webnf/davstore/blob/master/src/server/webnf/davstore/dav/xml.cljc

The main thing preventing it from being ready is, that I've utilized .cljc and reader tags. As of my last information, our CI doesn't support .cljc yet, for the test matrix and also it's unclear how to target clojure versions < 1.7

I'd be happy to the clojurescript support tested, though. We can still copy+paste into separate clj and cljs files, when we decide to release, if cljc support for contrib projects isn't ready by then.

Artem YarulinAugust 5, 2016 at 10:18 AM

Oh, that's super cool! If you need any testing - feel free to ping me, I'll be happy to help

Herwig HochleitnerAugust 4, 2016 at 8:40 PM

I'm working on clojurescript support in a separate branch: https://github.com/clojure/data.xml/tree/cljs
It can extend browser-native DOM objects to work with clojure data protocols.
Let me know what you think.

Completed

Details

Assignee

Reporter

Priority

Created November 13, 2015 at 9:49 AM
Updated December 8, 2016 at 3:48 AM
Resolved December 8, 2016 at 3:48 AM