;;;; Programmer: Kevin M. Rosenberg
;;;; Date Started: Apr 2000
;;;;
-;;;; $Id: xml-utils.lisp,v 1.6 2002/12/04 16:49:23 kevin Exp $
+;;;; $Id: xml-utils.lisp,v 1.7 2003/05/26 21:43:05 kevin Exp $
;;;;
;;;; This file, part of KMRCL, is Copyright (c) 2002 by Kevin M. Rosenberg
;;;;
(defun xml-cdata (str)
(concatenate 'string "<![CDATA[" str "]]>"))
+(defun write-xml-cdata (str s)
+ (declare (simple-string str) (optimize (speed 3) (safety 0)))
+ (do* ((len (length str))
+ (i 0 (1+ i)))
+ ((= i len) str)
+ (declare (fixnum i len))
+ (let ((c (schar str i)))
+ (case c
+ (#\< (write-string "<" s))
+ (#\& (write-string "&" s))
+ (t (write-char c s))))))
+