Lecture overview -- Keyboard shortcut: 'u'  Previous page: Markup subsumption -- Keyboard shortcut: 'p'  Next page: LAML Basics [Section] -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Page 10 : 30
XML Processing in LAML
Program subsumption

The XML fragments are represented as program fragments in the programming language

A program-only solution

(load (string-append laml-dir "laml.scm"))
(laml-style "simple-xhtml1.0-transitional-validating")
(set-xml-accept-extended-contents-in 'xhtml10-transitional #t)

(define (factorial x)
  (if (< x 2)
      x 
      (* x (factorial (- x 1)))))

(write-html '(raw prolog)
 (html 
   (head 
     (title "Factorial"))
  (body 
     (p "factorial(10) is" (factorial 10))))
)

(end-laml)

An example of a LAML document written in Scheme.