diff --git a/README.html b/README.html
index 799f9af..0757f44 100644
--- a/README.html
+++ b/README.html
@@ -115,7 +115,8 @@
Minor changes: clone-node on document as an extension. DOM
class hierarchy reworked. New function parse-empty-document.
Fixed the DOM serializer to not throw away local names.
- ANSI conformance fixes.
+ Fixed a long-standing bug in the parser for documents without a
+ doctype. ANSI conformance fixes.
rel-2006-01-05
diff --git a/xml/xml-parse.lisp b/xml/xml-parse.lisp
index 4672a6e..c2e8960 100644
--- a/xml/xml-parse.lisp
+++ b/xml/xml-parse.lisp
@@ -1278,6 +1278,11 @@
(mu target)))
(t
(values :PI (cons target content))))))
+ ((eq *data-behaviour* :DTD)
+ (unread-rune d input)
+ (unless (or (rune= #// d) (name-start-rune-p d))
+ (wf-error zinput "Expected '!' or '?' after '<' in DTD."))
+ (values :seen-< nil))
((rune= #// d)
(let ((c (peek-rune input)))
(cond ((name-start-rune-p c)
@@ -2605,6 +2610,11 @@
(setf (model-stack *ctx*) (list (make-root-model root))))
;; element
(let ((*data-behaviour* :DOC))
+ (when (eq (peek-token input) :seen-<)
+ (multiple-value-bind (c s)
+ (read-token-after-|<| input (car (zstream-input-stack input)))
+ (setf (zstream-token-category input) c
+ (zstream-token-semantic input) s)))
(p/element input))
;; optional Misc*
(p/misc*-2 input)