r8225: add entities for latin-1 characters
authorKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 16 Nov 2003 10:56:51 +0000 (10:56 +0000)
committerKevin M. Rosenberg <kevin@rosenberg.net>
Sun, 16 Nov 2003 10:56:51 +0000 (10:56 +0000)
genpage.lisp
project.lisp

index 4a00b5b0ec9a9be19ea8fe94e3b05a065d4a2394..9e34467e5744f30facdeead1ee3ba05ad19091c8 100644 (file)
@@ -12,7 +12,7 @@
 ;;;; This file, part of wol, is Copyright (c) 2003 by Kevin M. Rosenberg
 ;;;; *************************************************************************
 
-(in-package #:wol)
+(in-package wol)
 
 (defvar *header-table* (make-hash-table :size 100 :test 'eq)
   "Table of header functions indexed by site")
     (when title-str
       (html (:title (lml-write-string title-str)))))))
 
+(defvar +std-entities+ "<!ENTITY nbsp \"&#160;\">
+<!ENTITY reg \"&#174;\">
+<!ENTITY copy \"&#169;\">")
 
 (defun page-prologue (title format css altcss)
   (ecase format
     (:xml
-     (dtd-prologue format)
+     (dtd-prologue format :entities +std-entities+)
      (lml-format "<?xml-stylesheet type=\"text/css\" href=\"~A\" ?>~%"
                 (aif css it "http://b9.com/umlsxml.css"))
      (lml-write-string "<pagedata xmlns:xlink=\"http://www.w3.org/1999/xlink\" xmlns:html=\"http://www.w3.org/TR/REC-html40\">")
      (lml-write-string "<body>"))
     ((:xhtml :xhtml11 :xhtml10-strict :xhtml10-transitional
       :xhtml10-frameset)
-     (dtd-prologue format)
+     (dtd-prologue format :entities +std-entities+)
      (lml-write-string
       "<html xmlns=\"http://www.w3.org/1999/xhtml\" xml:lang=\"en\">")
      (ml-head title (aif css it "http://b9.com/main.css") altcss)
index ed1ef4892c8a0beb42db44cbe477bbc1f3c28290..5ff310459c74a72cf60b5dea71dc3c1869eaf98f 100644 (file)
       (net.aserve:with-http-response 
          ((aserve-request ,req) 
           (entity-aserve-entity ,ent)
-          :content-type (ml::format-string ,format)
+          :content-type (ml::format-string ,format ,headers)
           :timeout ,timeout
           :response
           (case ,response-code
           ,result ,outstr ,stream)
        (declare (ignorable ,stream))
        (write-header-line "Status" ,response-string)
-       (write-header-line "Content-Type" (ml::format-string ,fmt))
+       (write-header-line "Content-Type" (ml::format-string ,fmt ,headers))
        (dolist (,hdr ,headers)
         (write-header-line (car ,hdr) (cdr ,hdr)))
        (unless ,precomp