Lecture overview -- Keyboard shortcut: 'u'  Previous page: Markup subsumption -- Keyboard shortcut: 'p'  Next page: Program Subsumption - General Issues [Section] -- Keyboard shortcut: 'n'  Alphabetic index  Help page about these notes  Course home    Slide 8 : 15

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)