(defun xmls::write-escaped (string stream)
"Writes string to stream with all character entities escaped."
(coerce string 'string)
(when (eq stream t) (setf stream *standard-output*))
(dotimes (i (length string))
(let* ((char (char string i))
(code (char-code char)))
(if (> code 255)
(format nil "&#~S;" code)
(write-sequence (svref xmls::*char-escapes* code) stream)))))
(defun xmls::write-escaped (string stream)
"Writes string to stream with all character entities escaped."
(coerce string 'string)
(when (eq stream t) (setf stream *standard-output*))
(dotimes (i (length string))
(let* ((char (char string i))
(code (char-code char)))
(if (> code 255)
;; OOPS
(format stream "&#~S;" code)
(write-sequence (svref xmls::*char-escapes* code) stream)))))
The value #\รข is not of type BASE-CHAR.
[Condition of type TYPE-ERROR]
Restarts:
0: [ABORT] Abort handling SLIME request.
1: [ABORT] Reduce debugger level (leaving debugger, returning to toplevel).
2: [TOPLEVEL] Restart at toplevel READ/EVAL/PRINT loop.
Backtrace:
0: (SB-KERNEL:HAIRY-DATA-VECTOR-SET 3 "<p>
As <a href=\"http://lemonodor.com/archives/001077.html\">seen on Lemonodor</a>...
<blockquote>
<em>
The book <a href=\"http://www.amazon.com/exec/obidos/ASIN/1590592395/qid=1109294066/sr=2-1/ref=pd_ka_b_2_1/103-3914066-2665435\">Practical Common Lisp</a> shows the power of Lisp not only in the areas that it has traditionally been noted for