From 8fd122cb56e3d4a92c9c412d819abf04c04e4894 Mon Sep 17 00:00:00 2001 From: Chris Hanson Date: Fri, 26 Sep 2003 04:27:32 +0000 Subject: [PATCH] Fix bug in handling of processing instructions. --- v7/src/xml/xml-parser.scm | 31 ++++++++++++++----------------- 1 file changed, 14 insertions(+), 17 deletions(-) diff --git a/v7/src/xml/xml-parser.scm b/v7/src/xml/xml-parser.scm index ed08bfbb3..1a93909cf 100644 --- a/v7/src/xml/xml-parser.scm +++ b/v7/src/xml/xml-parser.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: xml-parser.scm,v 1.46 2003/09/26 03:56:54 cph Exp $ +$Id: xml-parser.scm,v 1.47 2003/09/26 04:27:32 cph Exp $ Copyright 2001,2002,2003 Massachusetts Institute of Technology @@ -548,26 +548,23 @@ USA. (transform (lambda (v) (let ((name (vector-ref v 0)) - (text - (and (fix:= (vector-length v) 2) - (vector-ref v 1)))) + (text (vector-ref v 1))) (if (string-ci=? (symbol-name name) "xml") (perror p "Reserved XML processor name" name)) - (if text - (let ((entry (assq name *pi-handlers*))) - (if entry - (let ((content ((cadr entry) text))) - (if (not (list-of-type? content valid-content?)) - (perror p - "Illegal output from XML processor" - name)) - (list->vector content)) - (vector - (make-xml-processing-instructions name text)))) - (vector)))) + (let ((entry (assq name *pi-handlers*))) + (if entry + (let ((content ((cadr entry) text))) + (if (not (list-of-type? content valid-content?)) + (perror p + "Illegal output from XML processor" + name)) + (list->vector content)) + (vector + (make-xml-processing-instructions name text)))))) (sbracket description start end parse-pi-name - (? (seq S parse-body))))))))) + (alt (seq S parse-body) + (values ""))))))))) (define parse-pi:misc (pi-parser -- 2.25.1