A command line tool to transform [[http://en.wikipedia.org/wiki/DTBook][dtbook xml source files]] into a braille format proprietary to [[http://www.sbs.ch][Swiss Library for the Blind, Visually Impaired and Print Disabled]] using [[http://saxon.sourceforge.net][Saxon]] with a [[https://github.com/sbsdev/LiblouisSaxonExtension][java extension]] that offers translating text into braille using [[http://www.liblouis.org][liblouis]].
ant -e -lib /usr/share/java/jdeb.jar clean dist package
cd dtbook2sbsform ./dtbook2sbsform.sh dtbook.xml
calls =saxon.sh=, transforms =dtbook.xml= and performs line breaking using =linebreak.sh= printing output onto stdout.
./saxon.sh
calls saxon, offering its rich command line interface, includes our extension function (see =resources/xsl/dtbook2sbsform.xsl=).
./linebreak.sh
breaks lines according to sbs rules: only lines beginning with a blank will be broken. Line width is 80 chars.
./utfx.sh
Performs [[http://utf-x.sourceforge.net/][utfx]] (svn version) tests.
Dependencies
junit
[[https://github.com/sbsdev/LiblouisSaxonExtension][liblouissaxonx]]
[[https://github.com/sbsdev/liblouis-javabindings][louis-1.0.jar]]
[[https://central.sonatype.com/artifact/net.sf.saxon/Saxon-HE/12.1/overview][saxon9he.jar]]
[[https://utf-x.sourceforge.net/manual/manual.html][utfxFat.jar]]
Prerequisite installs
Testing
This project has been ported to support testing via xprocspec tests. For legacy reasons however testing with =utfx= is still supported via a Docker image.
docker build -t dtbook2sbsform -f Dockerfile.test_with_utfx .
If you really want you can also build an image to test against old versions of liblouis and the braille tables:
docker build --build-arg LIBLOUIS_VERSION=3.10.2 --build-arg BRAILLE_TABLES_VERSION=1.12.5 -t dtbook2sbsform -f Dockerfile.test_with_utfx .
To run the tests using above image simply run
docker run --rm --volume=$(pwd):/usr/src/dtbook2sbsform -t dtbook2sbsform
To run a single test file use the following command:
docker run --rm --volume=$(pwd):/usr/src/dtbook2sbsform -t dtbook2sbsform -Dutfx.test.file=test_xsl/11_most_frequent_bugs_test.xml
*** Bernhard Wagner
Copyright 2011-2018 Swiss Library for the Blind, Visually Impaired and Print Disabled.
Licensed under GNU Lesser General Public License as published by the Free Software Foundation, either [[http://www.gnu.org/licenses/gpl-3.0.html][version 3]] of the License, or (at your option) any later version.