retrogradeorbit / bootleg

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

xml conversion not working in native-image binary #56

Closed retrogradeorbit closed 4 years ago

retrogradeorbit commented 4 years ago
$ bootleg -d -e '(convert-to [:link "foo"] :xml)'
bootleg: script error at line , column : Factory configuration error: Provider com.sun.xml.internal.stream.XMLOutputFactoryImpl not found
$ lein run -- -d -e '(convert-to [:link "foo"] :xml)'
"<?xml version=\"1.0\" encoding=\"UTF-8\"?><link>foo</link>"

Another reflection error?

borkdude commented 4 years ago

Also see https://github.com/borkdude/babashka/issues/153

retrogradeorbit commented 4 years ago

@borkdude ah thanks! Just guessed at the reflection config and it worked.

As an aside, I had to use the [org.clojure/data.xml "0.2.0-alpha6"] version, and then pass through the associated meta data to get xml namespaces working (so you can parse xml docs with namespaces, convert to hiccup, then back out and preserve the namespaces). xml parsing functionality is not exposed in bootleg yet as there are still some minor issues and unsupported hiccup functionality, but might help you integrate it into bb.

https://github.com/retrogradeorbit/bootleg/blob/master/src/bootleg/utils.clj#L307-L330

retrogradeorbit commented 4 years ago

I do plan on more complete xml support to come...

retrogradeorbit commented 4 years ago

Uploaded new build to release page.