diff --git a/XMLCONF b/XMLCONF index e4c835c..c131a30 100644 --- a/XMLCONF +++ b/XMLCONF @@ -847,21 +847,13 @@ oasis/p69fail2.xml [not-wf?] not-wf oasis/p69fail3.xml [not-wf?] not-wf oasis/p70fail1.xml [not-wf?] not-wf oasis/p71fail1.xml [not-wf?] not-wf -oasis/p71fail2.xml [not-wf?] FAILED: - well-formedness violation not detected -[ - Entity name is a Name, not an NMToken - ] +oasis/p71fail2.xml [not-wf?] not-wf oasis/p71fail3.xml [not-wf?] not-wf oasis/p71fail4.xml [not-wf?] not-wf oasis/p72fail1.xml [not-wf?] not-wf oasis/p72fail2.xml [not-wf?] not-wf oasis/p72fail3.xml [not-wf?] not-wf -oasis/p72fail4.xml [not-wf?] FAILED: - well-formedness violation not detected -[ - Entity name is a name, not an NMToken - ] +oasis/p72fail4.xml [not-wf?] not-wf oasis/p73fail1.xml [not-wf?] not-wf oasis/p73fail2.xml [not-wf?] not-wf oasis/p73fail3.xml [not-wf?] not-wf @@ -1845,4 +1837,4 @@ ibm/valid/P86/ibm86v01.xml [not validating:] input [validating:] input ibm/valid/P87/ibm87v01.xml [not validating:] input [validating:] input ibm/valid/P88/ibm88v01.xml [not validating:] input [validating:] input ibm/valid/P89/ibm89v01.xml [not validating:] input [validating:] input -12/1786 tests failed; 376 tests were skipped \ No newline at end of file +10/1786 tests failed; 376 tests were skipped \ No newline at end of file diff --git a/xml/xml-parse.lisp b/xml/xml-parse.lisp index ced8350..84afc27 100644 --- a/xml/xml-parse.lisp +++ b/xml/xml-parse.lisp @@ -77,7 +77,7 @@ ;; *data-behaviour* = :DTD ;; -;; :name +;; :nmtoken ;; :#required ;; :#implied ;; :#fixed @@ -652,7 +652,7 @@ (defun wf-error (x &rest args) (error 'well-formedness-violation - :format-control "Validity constraint violated: ~@?" + :format-control "Well-formedness violated: ~@?" :format-arguments (list x args))) (defvar *validate* t) @@ -1178,7 +1178,7 @@ ((rune= #/\+ c) :\+) ((name-rune-p c) (unread-rune c input) - (values :name (read-name-token input))) + (values :nmtoken (read-name-token input))) ((rune= #/# c) (let ((q (read-name-token input))) (cond ((equalp q '#.(string-rod "REQUIRED")) :|#REQUIRED|) @@ -1728,15 +1728,21 @@ (while (eq (peek-token input) :S) (consume-token input))) +(defun p/nmtoken (input) + (nth-value 1 (expect input :nmtoken))) + (defun p/name (input) - (nth-value 1 (expect input :name))) + (let ((result (p/nmtoken input))) + (unless (name-start-rune-p (elt result 0)) + (wf-error "Expected name.")) + result)) (defun p/attlist-decl (input) ;; [52] AttlistDecl ::= '' (let (elm-name) (expect input :|