The citeproc-js bundle contains a parsing file named xmljson.js, added
quite some time ago, after a conversation with Simon Kornblith.
In a browser environment, the xmljson.js parser makes it possible to
run citeproc-js in a worker thread, where DOM methods are not
permitted. Apart from converting the style and locale XML to
processor is run in the usual way, with the JS objects used as drop-in
replacements for the XML.
The missing piece to the puzzle has been the conversion method - for
initial testing, I used locales and styles pre-converted with a Python
script, which wasn’t terribly convenient for production. I recently
had a need for a JS version of the converter, so here it is:
It has a CC0 license, do with it what you will. Hope it makes things easier!