(load (string-append laml-dir "laml.scm")) (laml-style "xml-in-laml/lecture-notes/lecture-notes") (leno-front-matters (front-title "XML Processing in LAML") (front-subtitle "") (front-author "Kurt Nørmark") (front-affiliation "Department of Computer Science, Aalborg University, Denmark") (front-abstract "This lecture describes XML in LAML. The lecture was is given in Görlitz, Germany, on December 15 2005.") 'slide-view "true" 'annotated-slide-view "true" 'aggregated-view "true" 'primary-view "slide-view" 'scheme-suffix "post-notes.scm" 'course-home-url "../../index.html" 'author-home-url "http://www.cs.aau.dk/~normark/" 'note-download-url "" 'logo-url "http://www.auc.dk/" 'note-contents-description "" 'slide-header "normal" ; minimal/normal/none 'trail-of-lecture "false" 'language "english" 'show-and-speak "false" 'default-showing-time "2" 'additional-showing-time "0" 'sound-source "wave-file" 'speak-file-prefix "sound/" 'speak-url-prefix "../sound/" 'exercise-model "none" 'quiz-support "false" 'word-index "true" 'news-flash-string "" 'news-flash-level "2" 'verbosity-level "1" 'clean-html-directory "false" 'css-prestylesheet "large-size" 'css-stylesheet "original" ) (begin-notes) (note-page 'id "intr" (section-title "Introduction") ) (note-page 'id "denmark" (title (main-text "Where is Denmark?") (annotation "") ) (image 'src "europe.gif" (main-text "The location of Denmark in Europe" ) ) (index-words ) ) (note-page 'id "aalborg" (title (main-text "Where is Aalborg?") (annotation "") ) (image 'src "denmark.gif" (main-text "The location of Aalborg in Denmark" ) ) (index-words ) ) (note-page 'id "plan" (title (main-text "Plan of this talk") (annotation "") ) (items (item (main-text "XML fragments in relation to program fragments" )) (item (main-text "LAML basics" )) (item (main-text "Authoring of static web content in LAML") (items (item (main-text "Example throughout: Food recipes" ))) ) (item (main-text "Review of existing XML languages in LAML" )) (item (main-text "Related work")) (item (main-text "Conclusions" )) ) ) (note-page 'id "xml-pl-mixing-sec" (section-title "XML fragments and Program Fragments ") ) (note-page 'id "xml-pl-mixing" (title (main-text "Mixing XML and program fragments ") (annotation "") ) (point (main-text "As an overall interest we will analyze how to mix XML markup and programming notation in a single document" ) (annotation "" ) ) (items 'margin-left "9cm" 'margin-top "2cm" (item (main-text "Markup hosting" )) (item (main-text "Program hosting" )) (item (main-text "Markup subsumption" )) (item (main-text "Program subsumption" ))) ) (note-page 'id "markup-hosting" (title (main-text "Markup hosting") (annotation "") ) (point (main-text "Program fragments appear as constituents in a complete XML document" ) (annotation "" ) ) (source-program 'id "jspex1" 'margin-top "1.5cm" 'src "includes/jsp-simple" 'slide-mode "inline" 'book-mode "inline" (color-decorations (color-decoration 'from-mark "<%" 'to-mark "%>"'color "red" 'face "bold" 'repetition "3") ) (main-text "An short example of a JSP document." ) (annotation "The table part of the example is taken from www.jsptut.com" ) ) (source-program 'id "jspex2" 'drop "true" 'src "includes/jsp-example" 'slide-mode "external" 'book-mode "inline" (color-decorations (color-decoration 'from-mark "<%" 'to-mark "%>"'color "red" 'face "bold" 'repetition "23") ) (main-text "An example of a JSP document." ) (annotation "" ) ) ) (note-page 'id "program-hosting" (title (main-text "Program hosting") (annotation "") ) (point (main-text "XML fragments appear as constituents in a complete program" ) (annotation "" ) ) (source-program 'margin-top "1.5cm" 'src "includes/cgi-c-ex" 'slide-mode "inline" 'book-mode "inline" (color-decorations (color-decoration 'from-mark (html-protect "") 'to-mark (html-protect "") 'color "red" 'face "bold" ) (color-decoration 'from-mark (html-protect "

") 'to-mark (html-protect "

") 'color "red" 'face "bold" ) (color-decoration 'from-mark (html-protect "

") 'to-mark (html-protect ".") 'color "red" 'face "bold" 'repetition "3") ) (main-text "An example of a CGI program" ) (annotation "The example is taken from a CGI tutorial in C: http://www.cs.tut.fi/~jkorpela/forms/cgic.html" ) ) ) (note-page 'id "markup-subsumption" (title (main-text "Markup subsumption") (annotation "") ) (point (narrow-with "3cm") (main-text (p "Program fragments are represented in XML markup") (p "An XML-only solution") ) (annotation "" ) ) (source-program 'margin-top "1.5cm" 'src "includes/xexpr-ex-1" 'slide-mode "inline" 'book-mode "inline" (color-decorations (color-decoration 'from-mark (html-protect "") 'color "brown" 'face "bold") (color-decoration 'from-mark (html-protect " 10 ") 'to-mark "" 'color "blue" 'face "bold") ) (main-text "A factorial function programmed in the XML language XEXPR" ) (annotation "The examples is taken from http://www.w3.org/TR/xexpr/" ) ) ) (note-page 'id "program-subsumption" (title (main-text "Program subsumption") (annotation "") ) (point (narrow-with "4cm") (main-text (p "The XML fragments are represented as program fragments in the programming language") (p "A program-only solution") ) (annotation "" ) ) (source-program 'margin-top "1.5cm" 'src "includes/laml-fac-1.laml" 'slide-mode "inline" 'book-mode "inline" (color-decorations (color-decoration 'from-mark "(define" 'to-mark ")))))" 'color "brown" 'face "bold" ) (color-decoration 'from-mark "(html" 'to-mark "))))" 'color "red" 'face "bold" ) ) (main-text "An example of a LAML document written in Scheme" ) (annotation "" ) ) ) (note-page 'id "laml-basics-sec" (section-title "LAML Basics")) (note-page 'id "laml-basics" (title (main-text "LAML Basics") (annotation "") ) (point (narrow-with "3cm") (main-text "LAML means" (b "L")_ "isp" (b "A")_ "bstracted" (b "M")_ "arkup" (b "L")_ "anguage" ) (annotation "" ) ) (items 'margin-top "1.5cm" (item (main-text "LAML provides a Scheme mirror library for a given XML language -" (br) " defined by an XML DTD" ) (items (item (main-text "Each element in the XML language gives rise to a function in Scheme")) (item (main-text "A mirror function returns an abstract syntax tree")) (item (main-text "A mirror function has a very flexible parameter list")) (item (main-text "A mirror function validates a document fragment at document generation time")) ; (item (main-text "...")) ) ) ) (cross-references 'margin-top "2.0cm" (internet-reference 'href "../../document-description-in-scheme/html/dd-slide-mirror-ill.html" (main-text "More details" ))) (point 'margin-top "2cm" (main-text "We will do some life playing with the a simple HTML document to expore the way LAML is used in practice" ) ) ) (note-page 'id "static-authoring" (section-title "Authoring of Static Web Contents") ) (note-page 'id "recipes-adhoc-1" (title (main-text "Recipes") ) (point (narrow-with "3cm") (main-text "As an example, we want to publish food recipes as HTML pages on the web" ) (annotation "" ) ) (items 'margin-top "2cm" (item (main-text "Approaches:" ) (items (item (main-text "Write/generate ordinary HTML pages") ) (item (main-text "Carry out some ad hoc abstractions on top of the HTML details" )) (item (main-text "Define a recipe datastructure and functions that process the datastructure" )) (item (main-text "Establish a new recipe language and write processors for it") ) ))) ) (note-page 'id "recipe-html" (title (main-text "Simple HTML recipe pages") (annotation "") ) (point (narrow-with "7cm") (main-text "Using XHTML in LAML" ) ) (source-program 'src "includes/recipes-html-abstr/recipes-unabstracted.laml" 'from-mark "(div" 'to-mark "))" 'slide-mode "inline" 'book-mode "inline" (color-decorations ) (main-text "A single recipe" ) (annotation "" ) ) (source-program 'margin-top "1.0cm" 'src "includes/recipes-html-abstr/recipes-unabstracted.laml" 'slide-mode "external" 'book-mode "inline" (color-decorations (color-decoration 'from-mark "(html" 'to-mark "))))" 'color "red" 'face "bold" ) ) (main-text "Two recipes in context of the entire document" ) (annotation "" ) ) (cross-references (internet-reference 'href "../includes/recipes-html-abstr/recipes-unabstracted.html" (main-text "HTML recipe document" ))) (point (narrow-with "4cm") (main-text (p "Commonalities are not shared") (p "The level of abstraction is low") ) ) ) (note-page 'id "recipe-ad-hoc-abstractions" (title (main-text "Recipe abstractions on top of HTML") (annotation "") ) (point (main-text "Introducing simple Scheme functions on top of the HTML clauses" )) (source-program 'margin-top "1.0cm" 'src "includes/recipes-html-abstr/recipes-abstracted.laml" 'from-mark "(define (recipe" 'to-mark ")))" 'slide-mode "inline" 'book-mode "inline" (color-decorations ) (main-text "The recipe function" ) (annotation "" ) ) (source-program 'margin-top "1.0cm" 'src "includes/recipes-html-abstr/recipes-abstracted.laml" 'from-mark "(recipe " 'to-mark "\"\")" 'slide-mode "inline" 'book-mode "inline" (color-decorations ) (main-text "A call of the show-recipe function" ) ) (source-program 'margin-top "1.0cm" 'src "includes/recipes-html-abstr/recipes-abstracted.laml" 'slide-mode "external" 'book-mode "inline" (color-decorations (color-decoration 'from-mark "(define (recipe" 'to-mark ")))" 'color "blue" 'face "bold" ) (color-decoration 'from-mark " (recipe" 'to-mark ") " 'color "red" 'face "bold" 'repetition "2") ) (main-text "The entire document" ) (annotation "" ) ) (cross-references (internet-reference 'href "../includes/recipes-html-abstr/recipes-abstracted.html" (main-text "HTML recipe document" ))) (point 'margin-top "1.0cm" (narrow-with "-0.5cm") (main-text "Poor markup - Use of positional parameters - Use of lists as generic markup" )) ) (note-page 'id "recipe-xml-in-laml-abstractions" (title (main-text "Recipe abstractions on top of HTML") (annotation "") ) (point (main-text "Introducing XML-in-LAML abstractions on top of the HTML clauses" )) (source-program 'src "includes/recipes-html-abstr/recipes-xml-in-laml-abstracted.laml" 'from-mark "(define recipe" 'to-mark "))))))" 'slide-mode "inline" 'book-mode "inline" (color-decorations ) (main-text "The recipe XML-in-LAML function") ) (source-program 'margin-top "0.5cm" 'src "includes/recipes-html-abstr/recipes-xml-in-laml-abstracted.laml" 'from-mark "(recipe 'title" 'to-mark "(step \"...\")" 'slide-mode "inline" 'book-mode "inline" (color-decorations ) (main-text "An application of recipe") ) (source-program 'margin-top "0.5cm" 'src "includes/recipes-html-abstr/recipes-xml-in-laml-abstracted.laml" 'slide-mode "external" 'book-mode "inline" (color-decorations (color-decoration 'from-mark "(define recipe" 'to-mark ")))))" 'color "red" 'face "bold") (color-decoration 'from-mark "(recipe" 'to-mark "))" 'color "blue" 'face "bold" 'repetition "2") ) (main-text "The entire document") ) (cross-references (internet-reference 'href "../../../../lib/xml-in-laml/man/xml-in-laml.html#xml-in-laml-abstraction" (main-text "xml-in-laml-abstraction documentation" )) (internet-reference 'href "../includes/recipes-html-abstr/recipes-xml-in-laml-abstracted.html" (main-text "HTML recipe document" )) ) (point 'margin-top "1.0cm" ; (narrow-with "4cm") (main-text "Better markup - Better parameter passing - Manual programming" )) ) (note-page 'id "recipes-data-structures-1" (title (main-text "Recipe datastructure (1)") (annotation "") ) (point (main-text "Representing recipes as lists in Scheme" ) (narrow-with "3cm")) (source-program 'margin-left "4.5cm" 'margin-top "2.5cm" 'src "includes/recipes-ds/recipes.laml" 'from-mark " '(recipe" 'to-mark ")) " 'slide-mode "inline" 'book-mode "inline" (color-decorations ) (main-text "A recipe list structure" ) (annotation "" ) ) ) (note-page 'id "recipes-data-structures-2" (title (main-text "Recipe datastructure (2)") (annotation "") ) (point (main-text "Representing recipes as lists in Scheme" ) (narrow-with "3cm")) (source-program 'margin-top "1.0cm" 'src "includes/recipes-ds/recipes.laml" 'from-mark "(define (present-recipe" 'to-mark ")))))" 'slide-mode "inline" 'book-mode "inline" (color-decorations ) (main-text "A recipe list structure" ) (annotation "" ) ) (source-program 'margin-top "1.3cm" 'src "includes/recipes-ds/recipes.laml" 'slide-mode "external" 'book-mode "inline" (color-decorations (color-decoration 'from-mark "(define (present-recipe" 'to-mark ")))))" 'color "red" 'face "bold") (color-decoration 'from-mark "'(recipe" 'to-mark ")) " 'color "blue" 'face "bold" 'repetition "2") (color-decoration 'from-mark "(map present-recipe my-recipes)" 'to-mark "" 'color "purple" 'face "bold") ) (main-text "Entire document" ) (annotation "" ) ) (cross-references (internet-reference 'href "../includes/recipes-ds/recipes.html" (main-text "HTML recipe document" )) ) (point 'margin-top "2.5cm" (main-text "A raw list approach - Easy to make errors in list structure - misspelling and structural errors" ) (annotation "" ) ) ) (note-page 'id "recipe" (title (main-text "A Recipe XML language") (annotation "") ) (point (main-text "Given a recipe XML language we whish to establish a mirror of the XML language in Scheme, and to show recipes on the web." ) (annotation "" ) ) (items 'margin-top "1.2cm" (item (main-text (a 'href "../includes/recipes-xml-in-laml/dtd/recipes-as-html.html" "The Recipe DTD") ) (items (item (main-text (a 'href "../includes/recipes-xml-in-laml/dtd/parse-and-make-mirror.laml" "Parse and mirror generation script") )) )) (item (main-text "The mirror of the Recipe DTD in Scheme (a Scheme library)" ) (items (item (main-text "Automatically derived" )) (item (main-text "One function for each element in the DTD (full validation)" )) (item (main-text (a 'href "../includes/recipes-xml-in-laml/man/recipe.html" "As documented by SchemeDoc") )) )) (item (main-text (a 'href "../includes/recipes-xml-in-laml/recipes-edited.laml" "An XML-in-LAML Recipe document")) (items (item (main-text (a 'href "../includes/recipes-xml-in-laml/recipes-transformations.scm" "A Scheme program that transform it to XHTML") )) (item (main-text (a 'href "../includes/recipes-xml-in-laml/recipes-edited.html" "The resulting XHTML document") )) )) ) (point 'margin-top "0.7cm" (main-text "The recipe XML DTD and the recipe example document are due to Anders Møller and Michael Schwartzbach from Aarhus University" ) (annotation "The Manual DTD, documented on this page, is taken from Anders Møller and Michael Schwartzbachs forthcoming book on Internet technology." ) ) ) (note-page 'id "prog-authoring" (title (main-text "Programmatic Authoring") (annotation "") ) (point (main-text "By writing documents directly in a programming language you have excellent possibilities to" (em "fight complexity") "at any location in the document, and at any time in the development process" ) ) (items 'margin-top "1.5cm" (item (main-text "Complexity fighting means") (items (item (main-text "Introduction of functional abstractions" )) (item (main-text "Avoiding (repetitive) manual work by programmed solutions" ))))) (items 'margin-top "1.5cm" (item (main-text "Can documents in natural languages really be written in a programming language?" ) (items (item (main-text "Textual contributions in quoted strings" )) (item (main-text "Implicit concatenation, implicit list flattening, adequate white space handling" )) (item (main-text "Good editor support for common editing tasks" )) ))) ) (note-page 'id "" (section-title "Existing XML-in-LAML languages") ) (note-page 'id "basic-mirrors" (title (main-text "Basic Mirrors") (annotation "") ) (point (main-text (p "LAML supports mirrors of XHTML1.0 (strict, transitional, frameset), XHTM1.1, and SVG1.1") (p "Given an XML DTD it is usually straightforward to generate a mirror of it in LAML") ) ) (items 'margin-top "2.0cm" (item (main-text "Interface documentation of XHTML and SVG:" ) (items (item (main-text (a 'href "../../../../lib/xml-in-laml/mirrors/man/xhtml10-transitional-mirror.html" "XHTML1.0 Transitional"))) (item (main-text (a 'href "../../../../lib/xml-in-laml/mirrors/man/svg11-mirror.html" "SVG1.1"))) ))) (items 'margin-top "1.8cm" (item (main-text "SVG examples" ) (items (item (main-text "Makes use of an" (a 'href "../../../../lib/man/svg-extensions.html" "SVG extension library") "that supports" (string-it "relaxed") _ "," "animated graphs" )) (item (main-text (a 'target "svg-ex" 'href "../../../../examples/leno-xml-in-laml/svg-in-scheme-demo/html/svg-in-scheme-demo-slide-list-insertion.html" "List insertion example"))) (item (main-text (a 'href "../includes/svg-source.scm" "The source of the drawing") )) ))) ) (define end-of-slide-marker "; end leno slide") (note-page 'id "leno" (title (main-text "LENO") ) (point (main-text (p "These slides are made with the LENO system ") (p "LENO is an XML language for programmatic authoring of lecture notes") ) ) (items 'margin-top "1.5cm" (item (main-text "LENO features:" ) (items (item (main-text "Several different views" )) (item (main-text "Especially oriented towards slides with program examples" )) (item (main-text "Allows the author to grow a text book from a set of slides" )) (item (main-text "And more..." ))))) (source-program 'margin-top "1.5cm" 'src (in-startup-directory "xp.leno") 'from-mark "(note-page 'id \"leno\"" 'to-mark end-of-slide-marker 'slide-mode "external" 'book-mode "inline" (color-decorations ) (main-text "The XML-in-LAML Scheme source of this page" ) ) (cross-references (internet-reference 'href "http://www.cs.aau.dk/~normark/c-prog-05/html/notes/index.html" 'target "c-prog" (main-text "C Programming Material (in Danish)" )) (internet-reference 'href "http://www.cs.aau.dk/~normark/leno/index.html" 'target "c-prog" (main-text "The LENO Home page (WEB)")) ) ) ; end leno slide (note-page 'id "doc" (title (main-text "XML Languages for Program Documentation") (annotation "") ) (point (main-text (p "SchemeDoc is a language and tool for description and extraction of" (em "interface documentation") ) (p "The Scheme Elucidator is language and tool for" (em "internal program documentation") ) ) ) (items 'margin-top "1.5cm" (item (main-text "SchemeDoc" ) (items (item (main-text (a 'href "../../../../examples/schemedoc/man-1.sdoc" "XML-in-LAML setup (parameters/options)")) (items (item (main-text (a 'href "../../../../lib/man/color.html" "Sample library documentation") )))) (item (main-text "Extraction of Scheme library documentation from Scheme comments" )) (item (main-text "Documentation of XML DTD for which Scheme mirrors are provided" )))) (item (main-text "The Scheme Elucidator" ) (items (item (main-text (a 'href "../../../../examples/elucidator-2/scheme-documentation-tools/demo.laml" "XML-in-LAML setup as well as documentation") ) (items (item (main-text (a 'target "elu-demo" 'href "../../../../examples/elucidator-2/scheme-documentation-tools/demo.html" "Sample Elucidative program") ))) )))) ) (note-page 'id "edu" (title (main-text "Educational XML languages") (annotation "") ) (point (narrow-with "2.0cm") (main-text "In addition to LENO, LAML supports a number of additional XML languages for educational purposes" ) (annotation "" ) ) (items 'margin-top "2.0cm" 'margin-left "1.0cm" (item (main-text "Course home page language" ) (items (item (main-text (a 'href "../../../../../courses/basis-05/sources/programmering-i-c.laml" "Sample XML-in-LAML source")) ) (item (main-text (a 'href "../../../../../courses/basis-05/html/programmering-i-c.html" "Sample course home page") )))) (item (main-text "Program dissection language" ) (items (item (main-text (a 'href "../../../../../courses/basis-05/sources/dissections/10-7-normark-recursive.laml" "Sample XML-in-LAML source") )) (item (main-text (a 'href "../../../../../courses/basis-05/html/programs/10-7-normark-recursive.html" "Sampel program dissection") )))) (item (main-text "Semester evaluation language" ) ; (items ; (item ; (main-text (a 'href "../../../../styles/xml-in-laml/semester-eval/schemas-f05/default-schemas.scm" "Sample XML-in-LAML source - common stuff"))) ; (item ; (main-text (a 'href "../../../../styles/xml-in-laml/semester-eval/schemas-f05/f05.laml" "Sample XML-in-LAML source") ; )) ; (item ; (main-text (a 'href "../../../../styles/xml-in-laml/semester-eval/schemas-f05/html/info.html" "Sample semester evaluation form") ; ))) )) ) (note-page 'id "hobby" (title (main-text "Hobby Languages") (annotation "") ) (point (main-text "For my own pleasure I have made XML languages for photo management and songs with chords" ) ) ) (note-page 'id "ending" (section-title "Ending") ) (note-page 'id "rel-work" (title (main-text "Related Work") (annotation "") ) (point (narrow-with "2.0cm") (main-text (p "There are a number of other people who have done similar work in Scheme") (p "There are many other people who have done similar work in other functional programming languages") ) ) (items (item (main-text "Scribe and Skribe by Serrano and Gallesio") (items (item (main-text "Supports its own document language, with several backends" )) (item (main-text "Makes use of a special read syntax for" (string-it "semi-constant strings") )) (item (main-text "Inspirred, in part, by LAML" ))) ) (item (main-text "SXML by Oleg Kiselyov") (items (item (main-text "A list format for XML" )) (item (main-text "Supported by a parser and transformation software (SXSLT)" ))) ) (item (main-text "WebIt by Jim Bender") (items (item (main-text "Relies on SXML" )) (item (main-text "Does also support CSS in Scheme" ))) ) (item (main-text "BRL by Bruce Lewis") (items (item (main-text "For server side web applications" )) (item (main-text "Relies on a non-standard Scheme reader" ))) ) ) ) (note-page 'id "conclu" (title (main-text "Status") (annotation "") ) (items (item (main-text "Recent LAML papers" ) (items (item (main-text (string-it "Web Programming in Scheme with LAML") _ "," (em "Journal of Functional Programming")_ "," "January 2005" )) (item (main-text (string-it "Scheme Program Documentation tools") _ "," (em "The Scheme workshop 2004"))) (item (main-text (string-it "XML Transformations in Scheme with LAML - a minimalistic approach") _"," (em "International Lisp Conference, 2003") )) )) (item (main-text "New distributions on a regular basis" ) ) ) (point 'margin-top "5.7cm" (narrow-with "2.0cm") (main-text (p "LAML is free and open source available from") (p "http://www.cs.aau.dk/~normark/laml/") ) (annotation "" ) ) ) (end-notes)