Kurt Nřrmark ©
Department of Computer Science, Aalborg University, Denmark
Abstract Index References Contents | This is a presentation of document description and processing in Scheme, given i Görlitz, December 16, 2005. |
Introduction |
Plan of this talk Slide Note Contents Index References |
|
Doing web work in Scheme |
Different Approaches Slide Note Contents Index References |
|
|
XHTML Mirrors in LAML |
The idea of mirroring Slide Note Contents Index References |
|
The idea of bringing the XML language XHTML into the programming language Scheme by mirroring. |
Mirroring of XHTML (1) Slide Note Contents Index References |
|
Program: An illustration of the most basic mirror rules of LAML. |
|
Program: The XHTML counterpart. |
|
|
Mirroring of XHTML (2) Slide Note Contents Index References |
|
Program: Illustration of white space suppression. |
|
Program: The XHTML counterpart. |
|
Mirroring of XHTML (3) Slide Note Contents Index References |
|
Program: Passing of attribute lists and lists of textual contents. |
|
Program: The XHTML counterpart. |
|
|
Mirroring of XHTML (4) - More of the same... Slide Note Contents Index References |
|
Program: Passing of attribute lists and lists of textual contents. |
|
Program: The XHTML counterpart. |
|
|
Mirroring of XHTML (5) Slide Note Contents Index References |
|
Program: Using CSS attributes together with XHTML attributes. |
|
Program: The XHTML counterpart. |
|
|
Character transformation Slide Note Contents Index References |
|
Program: A sample XHTML document with a custom HTML character transformation table. | ![]() |
|
|
Summarizing the XHTML mirrors Slide Note Contents Index References |
|
|
|
Working with higher-order functions in LAML |
Combination of mirror functions: Tables (1) Slide Note Contents Index References |
|
Program: A idiomatic table presentation pattern in LAML. |
|
|
Combination of mirror functions: Tables (2) Slide Note Contents Index References |
|
Program: A idiomatic table presentation pattern in LAML. |
|
|
Open table forms Slide Note Contents Index References |
|
|
Program: A idiomatic table presentation pattern in LAML. |
|
Program: Entire document. |
|
XML-in-LAML abstractions Slide Note Contents Index References |
|
Program: The indent-pixels function. annotation |
|
|
Program: The use of the indent-pixels function. |
|
|
How to query HTML documents Slide Note Contents Index References |
|
Program: A sample HTML document. |
|
|
Another way to query HTML documents Slide Note Contents Index References |
|
Program: A sample HTML document. |
|
|
Being a little more advanced... |
Delayed procedural content items Slide Note Contents Index References |
|
Program: Use of a text steeling function. |
|
Program: Use of meta keywords. |
|
Program: Element counting. |
|
Program: Elements that depend on their immediate context. |
|
|
Close to the end |
So, what is LAML really? Slide Note Contents Index References |
|
|
|
Status Slide Note Contents Index References |
|
|
Exercises Slide Note Contents Index References |
Exercise 1. Time tables | In this exercise we will make a local Cottbus - Görlitz train time table. Assume, for instance, that we have the following list of defined stations: (define stations (list "Cottbus" "Spremberg" "Weisswasser" "Horka" "Görlitz")) Also assume, that the following list gives the number of minutes in between the stations (define minutes (list 22 12 26 18)) Write a function (time-table start-time) that generates a time table given that the train leaves Cottbus at start-time. Thus for instance this table. Next, write a function (time-table list-of-start-times) that can generate a more comprehensive time table. Like this one. I will propose that you give start-time in the universal time format. The Scheme function (current-time) gives the current time. You can use these functions if you prefer. |
Exercise 2. A color-text function | Write a Scheme markup function color-text of the following form: (color-text r g b . content-and-attributes) The three first parameters are integers between 0 and 255. The tail parameter list text-and-attributes is arbitrary XML contents and attributes. Examples of calls: (color-text 255 0 0 "This is some nice text") (color-text 255 0 0 "This is some" (em "nice") "text") (color-text 255 0 0 'class "my-class" "This is some" (em "nice") "text" _ ".") Alternatively you may go for a form: (color-text 'red r 'green g 'blue b content-and-attributes) such as (color-text 'red 255 'green 0 'blue 0 "This is some nice text") Implement the desired function in terms of an HTML span element. Use the function xml-in-laml-positional-abstraction to implement the mixed positional and LAML parameter passing. The function rgb-color-encoding is also useful. |
Exercise 3. Table Column Exercise | This exercises is oriented towards columns of tabular data. Given three columns of numeric data. Each column is a list of numbers or boolean false values. The column length may vary from column to column As an example, the first column col1 may be the list: (1 5 #f 9 17) This column may, together with two other columns, give the following table: 1 15 8 5 #f #f #f 0 11 9 6 17 Now, write a Scheme program supported by LAML that presents the table of columns. The table can be represented as the three individual columns. (And this is of course a little tricky, because HTML works with list of rows). #f values should be presented as blank table entries. In the fourth column, you should add the values in each row. When adding, the #f value and missing values (due to short columns) should be treated as 0. Thus, a function call like (present-table table) should show this table. |
Document Description and Processing in Scheme
Course home Author home About producing this web Previous lecture (top) Next lecture (top) Previous lecture (bund) Next lecture (bund)
Generated: December 19, 2005, 14:16:58