retrogradeorbit / bootleg

Simple template processing command line tool to help build static websites
Eclipse Public License 2.0
256 stars 12 forks source link

Fix reflection error preventing XML roundtrip #63

Closed retrogradeorbit closed 4 years ago

retrogradeorbit commented 4 years ago
$ bootleg -d -e '(convert-to (selmer "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Foo>{{foo}}</Foo>" {:foo "bar"} :data :html) :hiccup)'
bootleg: script error at line , column : Factory configuration error: Provider com.sun.xml.internal.stream.XMLInputFactoryImpl not found

from leiningen

$ lein run -- -d -e '(convert-to (selmer "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Foo>{{foo}}</Foo>" {:foo "bar"} :data :html) :hiccup)'
[:Foo {} "bar"]

thus:

$ lein run -- -e '(-> (selmer "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Foo>{{foo}}</Foo>" {:foo "bar"} :data :html) (convert-to :hiccup) (convert-to :xml))'
<?xml version="1.0" encoding="UTF-8"?><Foo>bar</Foo>

See #62

retrogradeorbit commented 4 years ago

but this doesnt work:

$ lein run -- -e '(-> (selmer "<?xml version=\"1.0\" encoding=\"UTF-8\"?><Foo>{{foo}}</Foo>" {:foo "bar"} :data) (convert-to :xml))'
Exception in thread "main" Syntax error compiling at (/tmp/form-init7788691691720444922.clj:1:73).
    at clojure.lang.Compiler.load(Compiler.java:7647)
    at clojure.lang.Compiler.loadFile(Compiler.java:7573)
    at clojure.main$load_script.invokeStatic(main.clj:452)
    at clojure.main$init_opt.invokeStatic(main.clj:454)
    at clojure.main$init_opt.invoke(main.clj:454)
    at clojure.main$initialize.invokeStatic(main.clj:485)
    at clojure.main$null_opt.invokeStatic(main.clj:519)
    at clojure.main$null_opt.invoke(main.clj:516)
    at clojure.main$main.invokeStatic(main.clj:598)
    at clojure.main$main.doInvoke(main.clj:561)
    at clojure.lang.RestFn.applyTo(RestFn.java:137)
    at clojure.lang.Var.applyTo(Var.java:705)
    at clojure.main.main(main.java:37)
Caused by: java.lang.NullPointerException
    at bootleg.utils$convert_to.invokeStatic(utils.clj:446)
    at bootleg.utils$convert_to.invoke(utils.clj:443)
    at sci.impl.interpreter$fn_call.invokeStatic(interpreter.cljc:428)
    at sci.impl.interpreter$fn_call.invoke(interpreter.cljc:428)
    at sci.impl.interpreter$eval_call.invokeStatic(interpreter.cljc:474)
    at sci.impl.interpreter$eval_call.invoke(interpreter.cljc:460)
    at sci.impl.interpreter$interpret.invokeStatic(interpreter.cljc:503)
    at sci.impl.interpreter$interpret.invoke(interpreter.cljc:492)
    at sci.impl.interpreter$eval_form.invokeStatic(interpreter.cljc:547)
    at sci.impl.interpreter$eval_form.invoke(interpreter.cljc:538)
    at sci.impl.interpreter$eval_string_STAR_.invokeStatic(interpreter.cljc:557)
    at sci.impl.interpreter$eval_string_STAR_.invoke(interpreter.cljc:550)
    at sci.impl.interpreter$eval_string$fn__1514.invoke(interpreter.cljc:570)
    at sci.impl.interpreter$eval_string.invokeStatic(interpreter.cljc:567)
    at sci.impl.interpreter$eval_string.invoke(interpreter.cljc:563)
    at sci.core$eval_string.invokeStatic(core.cljc:169)
    at sci.core$eval_string.invoke(core.cljc:137)
    at bootleg.hiccup$process_hiccup_data.invokeStatic(hiccup.clj:99)
    at bootleg.hiccup$process_hiccup_data.invoke(hiccup.clj:31)
    at bootleg.core$_main.invokeStatic(core.clj:73)
    at bootleg.core$_main.doInvoke(core.clj:57)
    at clojure.lang.RestFn.invoke(RestFn.java:421)
    at clojure.lang.Var.invoke(Var.java:388)
    at user$eval140.invokeStatic(form-init7788691691720444922.clj:1)
    at user$eval140.invoke(form-init7788691691720444922.clj:1)
    at clojure.lang.Compiler.eval(Compiler.java:7176)
    at clojure.lang.Compiler.eval(Compiler.java:7166)
    at clojure.lang.Compiler.load(Compiler.java:7635)
    ... 12 more
retrogradeorbit commented 4 years ago

Fixed in v0.1.8