Generated: Monday, November 14, 2011, 09:25:33 Copyright © 2011, Kurt Nørmark The local LAML software home page

XSL Formatting Objects Examples

The following LAML XSL-FO examples exist in this directory.

Via use of Apache FOP as post processor, it is possible to produce PDF files from a LAML source. The examples image-test and table-test illustrate how it can be done from XML-in-LAML sources via XHTML to XSL-FO transformations.

Kind LAML file FO File PDF File
Hello World hello-world.laml hello-world.fo hello-world.pdf
Simple test of images image-test.laml image-test.fo image-test.pdf
Simple test of tables table-test.laml table-test.fo table-test.pdf

The XHTML to XSL-FO transformations in lib/xml-in-laml/transformations/xhtml-to-xsl-fo.scm (as used in the two last examples) are preliminary, in-progress, and still not complete.

LAML can activate a FOP processor via the post processing facility of the function write-xml and process-xml. Please consult the documentation of write-xml.

Here are my own post processor defintions for files with extension "fo":

(define fop-system "/pack/site-java/fop/fop.sh")

(define (fo-process full-target-file-path-with-extension)
 (let ((initial-path (file-name-initial-path full-target-file-path-with-extension))
       (proper-file-name (file-name-proper full-target-file-path-with-extension))
       (ext (file-name-extension full-target-file-path-with-extension)))
  (system
   (string-append "cd " initial-path "; " fop-system " " proper-file-name "." ext " " "-pdf" " " initial-path proper-file-name "." "pdf"))))

They are located in my personal .laml file.