Lecture overview -- Keyboard shortcut: 'u'  Previous page: Recipe abstractions on top of HTML -- Keyboard shortcut: 'p'  Next page: Recipe datastructure (1) -- Keyboard shortcut: 'n'  Lecture notes - all slides and notes together  slide -- Keyboard shortcut: 't'  Help page about these notes  Alphabetic index  Course home  Page 17 : 30
XML Processing in LAML
Recipe abstractions on top of HTML

Introducing XML-in-LAML abstractions on top of the HTML clauses

(define recipe
  (xml-in-laml-abstraction  
    (lambda (c a)
      (let ((title (defaulted-get-prop 'title a "NO TITLE"))
            (ingredient-list (get-asts c "ingredient"))
            (step-list (get-asts c "step"))
            (comment (get-asts c "comment")))
        (div 'css:margin-bottom "2cm" (span "Recipe:" title) (br)
             "Ingredients:" (br)      (ul (map li ingredient-list))
             "Procedure:" (br)        (ol (map li step-list))
             (font 'size "1" comment))))))

The recipe XML-in-LAML function.

(recipe 'title "Pita Bread"
     (ingredient "1.5 tsp dry yeast") (ingredient "1 cup water") (ingredient "...")
     (step "Dissolve the yeast") (step "Add honey, folur and salt")  (step "...")

An application of recipe.

/user/normark/scheme/slides/goerlitz-05/xml-processing-in-laml/includes/recipes-html-abstr/recipes-xml-in-laml-abstracted.lamlThe entire document.

The entire document.

 

Better markup - Better parameter passing - Manual programming