Commit 4ccdc76b authored by Sven Van Caekenberghe's avatar Sven Van Caekenberghe
Browse files

added :start and :end keywords to print-string-xml

parent 96e5d471
;;;; -*- mode: lisp -*-
;;;; $Id: xml.lisp,v 1.4 2004/08/19 14:55:20 bmastenbrook Exp $
;;;; $Id: xml.lisp,v 1.5 2004/10/22 10:36:58 scaekenberghe Exp $
;;;; This is a Common Lisp implementation of a very basic XML parser.
;;;; The parser is non-validating and not at all complete (no CDATA).
......@@ -80,9 +80,10 @@
:adjustable t
:fill-pointer 0))
(defun print-string-xml (string stream)
(defun print-string-xml (string stream &key (start 0) end)
"Write the characters of string to stream using basic XML conventions"
(loop for char across string
(loop for offset upfrom start below (or end (length string))
for char = (char string offset)
do (case char
(#\& (write-string "&" stream))
(#\< (write-string "&lt;" stream))
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment