[cxml-cvs] CVS update: cxml/xml/unparse.lisp cxml/xml/xml-parse.lisp

David Lichteblau dlichteblau at common-lisp.net
Sat Nov 26 23:57:11 UTC 2005


Update of /project/cxml/cvsroot/cxml/xml
In directory common-lisp.net:/tmp/cvs-serv23697/xml

Modified Files:
	unparse.lisp xml-parse.lisp 
Log Message:
-sun/not-wf/pi.xml [not-wf?] FAILED:
-  well-formedness violation not detected
-[
-    No space between PI target name and data]
-ibm/not-wf/P24/ibm24n02.xml [not-wf?] FAILED:
-  well-formedness violation not detected
-[
-    Tests VersionInfo with a required field missing. The white space is
-    missing between the key word "xml" and the VersionInfo in the XMLDecl.
-  ]

sowie massenhaft :eof-pruefungen

Date: Sun Nov 27 00:57:10 2005
Author: dlichteblau

Index: cxml/xml/unparse.lisp
diff -u cxml/xml/unparse.lisp:1.1.1.6 cxml/xml/unparse.lisp:1.2
--- cxml/xml/unparse.lisp:1.1.1.6	Sun Mar 13 19:02:56 2005
+++ cxml/xml/unparse.lisp	Sun Nov 27 00:57:10 2005
@@ -291,8 +291,9 @@
   (unless (rod-equal target '#.(string-rod "xml"))
     (write-rod '#.(string-rod "<?") sink)
     (write-rod target sink)
-    (write-rune #/space sink)
-    (write-rod data sink)
+    (when data
+      (write-rune #/space sink)
+      (write-rod data sink))
     (write-rod '#.(string-rod "?>") sink)))
 
 (defmethod sax:start-cdata ((sink sink))


Index: cxml/xml/xml-parse.lisp
diff -u cxml/xml/xml-parse.lisp:1.11 cxml/xml/xml-parse.lisp:1.12
--- cxml/xml/xml-parse.lisp:1.11	Sun Nov 27 00:25:29 2005
+++ cxml/xml/xml-parse.lisp	Sun Nov 27 00:57:10 2005
@@ -1079,7 +1079,7 @@
         (setf (elmdef-external-p e) *markup-declaration-external-p*)
         e))))
 
-(defvar *redefinition-warning* t)
+(defvar *redefinition-warning* nil)
 
 (defun define-attribute (dtd element name type default)
   (let ((adef (make-attdef :element element
@@ -1313,6 +1313,11 @@
           (t
            (error "Bad character ~S after \"<!\"" d)))))
 
+(definline read-S? (input)
+  (while (member (peek-rune input) '(#/U+0020 #/U+0009 #/U+000A #/U+000D)
+                 :test #'eql)
+    (consume-rune input)))
+
 (defun read-attribute-list (zinput input imagine-space-p)
   (cond ((or imagine-space-p
              (let ((c (peek-rune input)))
@@ -1348,11 +1353,6 @@
                (perror input "Expected \";\"."))
              (values :NAMED name))))))
 
-(definline read-S? (input)
-  (while (member (peek-rune input) '(#/U+0020 #/U+0009 #/U+000A #/U+000D)
-                 :test #'eq)
-    (consume-rune input)))
-
 (defun read-tag-2 (zinput input kind)
   (let ((name (read-name-token input))
         (atts nil))
@@ -1547,8 +1547,15 @@
       (unless (name-start-rune-p c)
         (error "Expecting name after '<?'"))
       (setf name (read-name-token input)))
-    (values name
-            (read-pi-content input))))
+    (cond
+      ((member (peek-rune input) '(#/U+0020 #/U+0009 #/U+000A #/U+000D)
+	       :test #'eql)
+	(values name (read-pi-content input)))
+      (t
+	(unless (and (eql (read-rune input) #/?)
+		     (eql (read-rune input) #/>))
+	  (wf-error "malformed processing instruction"))
+	(values name "")))))
 
 (defun read-pi-content (input &aux d)
   (read-S? input)
@@ -1557,6 +1564,8 @@
       (tagbody
        state-1
         (setf d (read-rune input))
+	(unless d
+	  (error 'end-of-xstream))
         (unless (data-rune-p d)
           (error "Illegal char: ~S." d))
         (when (rune= d #/?) (go state-2))
@@ -1564,6 +1573,8 @@
         (go state-1)
        state-2 ;; #/? seen
         (setf d (read-rune input))
+	(unless d
+	  (error 'end-of-xstream))
         (unless (data-rune-p d)
           (error "Illegal char: ~S." d))
         (when (rune= d #/>) (return))




More information about the Cxml-cvs mailing list