X-Git-Url: http://git.kpe.io/?p=kmrcl.git;a=blobdiff_plain;f=xml-utils.lisp;h=be7952bfedad0f612311db2d5f4553771301447b;hp=20029fe109a29b449736cffb0955099790c73e1e;hb=45326a2fd9e7761899d593d7f528abf455453b0b;hpb=0b55b495d74fc4fe1eea77acc4758ed6241aa3c8 diff --git a/xml-utils.lisp b/xml-utils.lisp index 20029fe..be7952b 100644 --- a/xml-utils.lisp +++ b/xml-utils.lisp @@ -7,7 +7,7 @@ ;;;; 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 ;;;; @@ -91,3 +91,15 @@ and position of character following end tag." (defun xml-cdata (str) (concatenate 'string "")) +(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)))))) +