/usr/share/gauche-0.9/0.9.4/lib/sxml/to-html.scm is in gauche 0.9.4-6.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 | ;;;
;;; sxml.to-html - SXML->HTML translator
;;;
;;; This file is mechanically translated for Gauche from
;;; Oleg Kiselyov's SXML->HTML.scm.
;;; Public domain.
;;;
(define-module sxml.to-html
(use text.parse)
(use sxml.adaptor)
(use sxml.tree-trans)
(export SXML->HTML))
(select-module sxml.to-html)
;; NB: this is included only for backward compatibility.
;; Use of sxml.tools is strongly recommended.
;;; Generated from "SXML-to-HTML.scm"
(define (SXML->HTML tree) (SRV:send-reply (pre-post-order tree `((|@| ((*default* unquote (lambda (attr-key . value) (enattr attr-key value)))) unquote (lambda (trigger . value) (cons '|@| value))) (*default* unquote (lambda (tag . elems) (entag tag elems))) (*text* unquote (lambda (trigger str) (if (string? str) (string->goodHTML str) str))) (html:begin unquote (lambda (tag title . elems) (list "Content-type: text/html" nl nl "<HTML><HEAD><TITLE>" title "</TITLE></HEAD>" elems "</HTML>")))))))
(define (entag tag elems) (if (and (pair? elems) (pair? (car elems)) (eq? '|@| (caar elems))) (list #\newline #\< tag (cdar elems) #\> (and (pair? (cdr elems)) (list (cdr elems) "</" tag #\>))) (list #\newline #\< tag #\> (and (pair? elems) (list elems "</" tag #\>)))))
(define (enattr attr-key value) (if (null? value) (list #\space attr-key) (list #\space attr-key "=\"" value #\")))
(define string->goodHTML (make-char-quotator '((#\< . "<") (#\> . ">") (#\& . "&") (#\" . """))))
;; Local variables:
;; mode: scheme
;; end:
|