The meeting was held at the offices of LShift . We agreed at the meeting to hold regular meetings on the first Wednesday of every month from now on. This makes the next meeting on the 5th of February 2003. We're looking for people willing and able to present material at the next meeting.
Noel Welsh gave a talk about XML processing in Scheme. Material extened the presentation given in December to cover XML transformations using the SSAX toolkit. See the main page for SSAX the notes and some additional files prepared for the talk. After much difficulty attempting to write the identity parser Noel agreed to prepare a separate writeup detailing it. This will appear later.
Note that this file was generated using the SSAX toolkit. The source code is below.
;; Template for Jan 8 2003 meeting of Scheme UK ;; A Scheme program that evaluates to SXML that then has stylesheets ;; applied to convert it into HTML and text #cs(module jan-8-2002 mzscheme (require (lib "ssax.ss" "ssax") (lib "myenv.ss" "ssax") (lib "input-parse.ss" "ssax") "sxml-tree-transform.ss" "sxml-to-html.ss") (provide make-files) ;; Contract: ;; read-all : input-port -> string ;; ;; Purpose: ;; Read all the content from a port, returning it as a single ;; string with line breaks. (define (read-all port) (let ((line (read-line port))) (if (eof-object? line) "" (string-append line "\n" (read-all port))))) ;; Contract: ;; make-link : string string -> sxml (define (make-link url text) `(a (@ (href ,url)) ,text)) ;; Contract: ;; flatten : (tree-of 'a) -> (list-of 'a) (define (flatten tree) (cond ((null? tree) '()) (else (cond ((pair? (car tree)) (flatten (append (car tree) (cdr tree)))) (else (cons (car tree) (flatten (cdr tree)))))))) ;; The SXML document (define document ` (document "8 Jan 2002" (p "The meeting was held at the offices of " ,(make-link "http://www.lshift.net/contact.html" "LShift") ". We agreed at the meeting to hold regular meetings on the first Wednesday of every month from now on. This makes the next meeting on the 5th of February 2003. We're looking for people willing and able to present material at the next meeting.") (p "Noel Welsh gave a talk about XML processing in Scheme. Material extened the presentation given in December to cover XML transformations using the SSAX toolkit. See the " ,(make-link "http://ssax.sourceforge.net/" "main page for SSAX") " the " ,(make-link "xml.html" "notes") " and some " ,(make-link "ssax.tar.gz" "additional files") " prepared for the talk. After much difficulty attempting to write the identity parser Noel agreed to prepare a separate writeup detailing it. This will appear later.") (p "Note that this file was generated using the SSAX toolkit. The source code is below.") (include "jan-8-2002.ss"))) ;; Contract: ;; html-stylesheet : sxml -> sxml (define (html-stylesheet tree) (post-order tree `((document . ,(lambda (tree) (let ((title (car (cdr tree))) (rest (cdr (cdr tree)))) `(html (head (link (@ (rel "stylesheet") (type "text/css") (href "../schematics.css"))) (title "Scheme UK Meeting: " ,title)) (body (h1 (img (@ (src "../schematics.jpg") (alt "Project Schematics"))) (br) "Scheme UK Meeting: ", title) ,rest))))) (include . ,(lambda (tree) (let ((filename (car (cdr tree)))) `(pre ,(with-input-from-file "jan-8-2002.ss" (lambda () (read-all (current-input-port)))))))) (*default* . ,(lambda (tree) tree)) (*text* . ,(lambda (string) string))))) ;; Contract: ;; text-stylesheet : sxml -> string (define (text-stylesheet tree) (apply string-append (flatten (post-order tree `((document . ,(lambda (tree) (let ((title (car (cdr tree))) (rest (cdr (cdr tree)))) (cons (string-append "Notes for Scheme UK Meeting: " title "\n" "============================================================") rest)))) (p . ,(lambda (tree) (cons "\n\n" (cdr tree)))) (a . ,(lambda (tree) (let ((href (car (car (cdr tree)))) (text (car (cdr (cdr tree))))) (printf "attrs: ~a/~a~n" href tree) (list text " (" href ")")))) (include . ,(lambda (tree) (let ((filename (car (cdr tree)))) (list "\n\n" (with-input-from-file "jan-8-2002.ss" (lambda () (read-all (current-input-port)))))))) (*default* . ,(lambda (tree) (cdr tree))) (*text* . ,(lambda (string) string))))))) ;; Contract: ;; document->html : sxml -> sxml (define (document->html document) (SXML->HTML (html-stylesheet document))) ;; Contract: ;; save-file : string string -> void (define (save-file filename string) (with-output-to-file filename (lambda () (display string)) 'replace)) (define base-filename "jan-8-2002") ;; Run this to make the text and HTML files (define (make-files) (save-file (string-append base-filename ".html") (document->html document)) (save-file (string-append base-filename ".txt") (text-stylesheet document))) )