Skip to content

Latest commit

 

History

History
49 lines (39 loc) · 1.54 KB

README.md

File metadata and controls

49 lines (39 loc) · 1.54 KB

License

DocBookInJar

What is this?

DocBookInJar is merely a demonstration of one approach to running XSLT transformations on DocBook documents "out of the JAR". That is, we don't need the stylesheets on the filesystem: they're provided as resources in the JAR. This demonstration uses:

  • DocBook 1.79.2 stylesheets
  • Saxon-HE 12.3
  • Java 9

Getting started

To demonstrate that this approach works, you can clone this repository and run:

mvn clean test

That's it. It's just a proof of concept.

Using Java 8

The java-8 branch contains modifications to allow this demonstration to run under Java 8. The principal difference is how the URLStreamHandler is provided at runtime.

  • Java 9: ClasspathURLStreamHandlerProvider returns the URLStreamHandler, and is registered via META-INF/services.
  • Java 8: ClasspathURLStreamHandlerFactory returns the URLStreamHandler, and is registered via a call to URL.setURLStreamHandlerFactory().

Background

The motivation for doing this is described in a post to Stack Overflow. The approach itself, provided by Jukka Matilainen, is described in this comprehensive answer, and this pull request.