Reject documents that contain entity references whose replacement text
authorChris Hanson <org/chris-hanson/cph>
Sun, 2 Mar 2003 02:48:39 +0000 (02:48 +0000)
committerChris Hanson <org/chris-hanson/cph>
Sun, 2 Mar 2003 02:48:39 +0000 (02:48 +0000)
isn't fully defined.

v7/src/xml/xml-parser.scm

index 85e6c998beafe78f1831aefeb2a45b2235449fcb..22e9e5172f2ca30abc8751585254a927b14a4c64 100644 (file)
@@ -1,6 +1,6 @@
 #| -*-Scheme-*-
 
-$Id: xml-parser.scm,v 1.22 2003/03/01 16:53:16 cph Exp $
+$Id: xml-parser.scm,v 1.23 2003/03/02 02:48:39 cph Exp $
 
 Copyright 2001,2002,2003 Massachusetts Institute of Technology
 
@@ -713,7 +713,11 @@ USA.
                      (if expand?
                          (expand-entity-value-string name (car elements) p)
                          (vector (car elements)))
-                     (vector (make-xml-entity-ref name)))))
+                     (begin
+                       (if (or *standalone?* *internal-dtd?*)
+                           (perror p "Reference to partially-defined entity"
+                                   name))
+                       (vector (make-xml-entity-ref name))))))
              (begin
                (if (or *standalone?* *internal-dtd?*)
                    (perror p "Reference to undefined entity" name))