[liblouis-liblouisxml] Re: Dividing a Book Into Volumes

  • From: "John J. Boyer" <john.boyer@xxxxxxxxxxxxxxxxx>
  • To: liblouis-liblouisxml@xxxxxxxxxxxxx
  • Date: Mon, 17 May 2010 23:09:13 -0500

On the matter of volume title pages and end-of-volume notices: I think 
that since tghese will be unique for each book the best apporach would 
be not to specify them as files in configuration settings but to create 
liblouisxml hard-coded styles for them. These styles could be called 
volumetitle and volumeend. They could congain nested styles as necessary 
and also some kind of template for variables such as volume number. 
"Hard-coded" means that the styles would be assigned semantic actions, 
unlike user-defined styles. On encountering these semantic actiolns 
liblouisxml would execute special code.

Feedback welcome!
John

On Mon, May 17, 2010 at 03:45:48PM +0200, Christian Egli wrote:
> "John J. Boyer" <john.boyer@xxxxxxxxxxxxxxxxx> writes:
> 
> > Each volume will also need a title page and an end-of-volume notice. 
> > These could be files specified by the configuration setings volumeStart 
> > and VolumeEnd Some things within these files will have to be changed 
> > from volume to volume, such as the volume number and the beginning and 
> > ending braille and print numbers. I am uncertain how this will be done. 
> > xslt could be used, but this would introduce a dependency on another 
> > library. There is probably a simpler method.
> 
> Some form of templating will be needed. XSLT is of course a standard and
> well known method (and readily available). I'm not that worried about
> the additional dependency, especially since it is for liblouisxml which
> is less likely to be deployed on embedded devices. However I agree that
> xslt might be a bit heavy if all you need is some form of variable
> replacement. You could for example define a number of variables (such as
> volume_number) place them within some markers ( maybe "{% volume_number
> %}") and have a sed process which just replaces all these with the value
> of volume_number. Of course you'd have to implement this in C which is
> tedious (if you refrain from using third party libraries for the
> purpose).
> 
> In the end it comes down to balance the pros and cons of an xslt based
> solution versus a custom made minimal templating solution.
> 
> A custom solution adds a lot of code and has to be maintained and
> documented while a xslt based solution uses standard technology which is
> documented everywhere.
> 
> Hope that helps
> Christian
> -- 
> Christian Egli
> Swiss Library for the Blind, Visually Impaired and Print Disabled
> Grubenstrasse 12, CH-8045 Z??rich, Switzerland
> For a description of the software and to download it go to
> http://www.jjb-software.com

-- 
John J. Boyer; President, Chief Software Developer
Abilitiessoft, Inc.
http://www.abilitiessoft.com
Madison, Wisconsin USA
Developing software for people with disabilities

For a description of the software and to download it go to
http://www.jjb-software.com

Other related posts: