Scratch that, had the wrong code in the file. Another way to get around all this is to use ocaml-d3: https://github.com/seliopou/ocaml-d3 This will give you a nice (and type-safe) API to make data-driven interfaces, D3.s setups up all the basic xml namespaces for you so you don't have to fight with that. On Sat, Jan 2, 2016 at 3:53 PM, Spiros Eliopoulos wrote: > Inserting a cast solves the type error: > > $ echo > toto.ml < let svg = Dom_svg.createSvg (Dom_html.window##document :> Dom_svg.document) > > EOF > $ ocamlfind ocamlc -syntax camlp4o -package "js_of_ocaml > js_of_ocaml.syntax" -c toto.ml > $ echo $? > 0 >