-ibm/not-wf/P32/ibm32n09.xml [not validating:] FAILED:

-  well-formedness violation not detected
-[
-    This is test violates WFC: Entity Declared in P68.
-    The standalone document declaration has the value yes, BUT there is an
-    external markup declaration of an entity (other than amp, lt, gt, apos,
-    quot), and references to this entity appear in the document.
-  ]
This commit is contained in:
dlichteblau
2005-11-27 18:41:06 +00:00
parent 487338d20e
commit ab0a676042
3 changed files with 23 additions and 35 deletions

25
XMLCONF
View File

@ -469,11 +469,7 @@ sun/invalid/attr16.xml [not validating:] input [validating:] invalid
sun/invalid/utf16b.xml [not validating:] input [validating:] invalid sun/invalid/utf16b.xml [not validating:] input [validating:] invalid
sun/invalid/utf16l.xml [not validating:] input [validating:] invalid sun/invalid/utf16l.xml [not validating:] input [validating:] invalid
sun/invalid/empty.xml [not validating:] input [validating:] invalid sun/invalid/empty.xml [not validating:] input [validating:] invalid
sun/not-wf/not-sa03.xml [not validating:] FAILED: sun/not-wf/not-sa03.xml [not validating:] not-wf [validating:] invalid
well-formedness violation not detected
[
Tests the Entity Declared WFC, ensuring that
a reference to externally defined entity causes a well-formedness error.]
sun/not-wf/attlist01.xml [not validating:] not-wf [validating:] not-wf sun/not-wf/attlist01.xml [not validating:] not-wf [validating:] not-wf
sun/not-wf/attlist02.xml [not validating:] not-wf [validating:] not-wf sun/not-wf/attlist02.xml [not validating:] not-wf [validating:] not-wf
sun/not-wf/attlist03.xml [not validating:] not-wf [validating:] not-wf sun/not-wf/attlist03.xml [not validating:] not-wf [validating:] not-wf
@ -1100,14 +1096,7 @@ ibm/not-wf/P32/ibm32n08.xml [not validating:] FAILED:
Tests SDDecl with wrong field ordering. The "=" sign occurs Tests SDDecl with wrong field ordering. The "=" sign occurs
after the key word "yes" in the SDDecl in the XMLDecl. after the key word "yes" in the SDDecl in the XMLDecl.
] ]
ibm/not-wf/P32/ibm32n09.xml [not validating:] FAILED: ibm/not-wf/P32/ibm32n09.xml [not validating:] not-wf [validating:] invalid
well-formedness violation not detected
[
This is test violates WFC: Entity Declared in P68.
The standalone document declaration has the value yes, BUT there is an
external markup declaration of an entity (other than amp, lt, gt, apos,
quot), and references to this entity appear in the document.
]
ibm/not-wf/P39/ibm39n01.xml [not validating:] not-wf [validating:] not-wf ibm/not-wf/P39/ibm39n01.xml [not validating:] not-wf [validating:] not-wf
ibm/not-wf/P39/ibm39n02.xml [not validating:] not-wf [validating:] not-wf ibm/not-wf/P39/ibm39n02.xml [not validating:] not-wf [validating:] not-wf
ibm/not-wf/P39/ibm39n03.xml [not validating:] not-wf [validating:] not-wf ibm/not-wf/P39/ibm39n03.xml [not validating:] not-wf [validating:] not-wf
@ -1289,13 +1278,7 @@ ibm/not-wf/P68/ibm68n02.xml [not validating:] not-wf [validating:] not-wf
ibm/not-wf/P68/ibm68n03.xml [not validating:] not-wf [validating:] not-wf ibm/not-wf/P68/ibm68n03.xml [not validating:] not-wf [validating:] not-wf
ibm/not-wf/P68/ibm68n04.xml [not validating:] not-wf [validating:] not-wf ibm/not-wf/P68/ibm68n04.xml [not validating:] not-wf [validating:] not-wf
ibm/not-wf/P68/ibm68n05.xml [not validating:] not-wf [validating:] not-wf ibm/not-wf/P68/ibm68n05.xml [not validating:] not-wf [validating:] not-wf
ibm/not-wf/P68/ibm68n06.xml [not validating:] FAILED: ibm/not-wf/P68/ibm68n06.xml [not validating:] not-wf [validating:] invalid
well-formedness violation not detected
[
Tests EntityRef which is against P68 WFC: Entity Declared. The
entity with the name "aaa" in the EntityRef in the AttValue in the STag of
the element "root" is externally declared, but standalone is "yes".
]
ibm/not-wf/P68/ibm68n07.xml [not validating:] not-wf [validating:] not-wf ibm/not-wf/P68/ibm68n07.xml [not validating:] not-wf [validating:] not-wf
ibm/not-wf/P68/ibm68n08.xml [not validating:] not-wf [validating:] not-wf ibm/not-wf/P68/ibm68n08.xml [not validating:] not-wf [validating:] not-wf
ibm/not-wf/P68/ibm68n09.xml [not validating:] not-wf [validating:] not-wf ibm/not-wf/P68/ibm68n09.xml [not validating:] not-wf [validating:] not-wf
@ -1853,4 +1836,4 @@ ibm/valid/P86/ibm86v01.xml [not validating:] input [validating:] input
ibm/valid/P87/ibm87v01.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/P88/ibm88v01.xml [not validating:] input [validating:] input
ibm/valid/P89/ibm89v01.xml [not validating:] input [validating:] input ibm/valid/P89/ibm89v01.xml [not validating:] input [validating:] input
13/1786 tests failed; 376 tests were skipped 10/1786 tests failed; 376 tests were skipped

View File

@ -6,7 +6,7 @@
(in-package :cl-user) (in-package :cl-user)
(defpackage :cxml (defpackage :cxml
(:use :cl :runes :encoding :trivial-gray-streams) (:use :cl :runes :runes-encoding :trivial-gray-streams)
(:export (:export
;; xstreams ;; xstreams
#:make-xstream #:make-xstream

View File

@ -62,7 +62,7 @@
;; slot of zstreams instead). ;; slot of zstreams instead).
;; Common ;; Common
;; :xml-pi (<target> . <content>) ;processing-instruction starting with "<?xml" ;; :xml-decl (<target> . <content>) ;processing-instruction starting with "<?xml"
;; :pi (<target> . <content>) ;processing-instruction ;; :pi (<target> . <content>) ;processing-instruction
;; :stag (<name> . <atts>) ;start tag ;; :stag (<name> . <atts>) ;start tag
;; :etag (<name> . <atts>) ;end tag ;; :etag (<name> . <atts>) ;end tag
@ -665,7 +665,7 @@
:format-arguments (list stream x args))) :format-arguments (list stream x args)))
(defvar *validate* t) (defvar *validate* t)
(defvar *markup-declaration-external-p* nil) (defvar *external-subset-p* nil)
(defun validate-start-element (ctx name) (defun validate-start-element (ctx name)
(when *validate* (when *validate*
@ -816,7 +816,8 @@
(:constructor make-internal-entdef (value)) (:constructor make-internal-entdef (value))
(:conc-name #:entdef-)) (:conc-name #:entdef-))
(value (error "missing argument") :type rod) (value (error "missing argument") :type rod)
(expansion nil)) (expansion nil)
(external-subset-p *external-subset-p*))
(defstruct (external-entdef (defstruct (external-entdef
(:include entdef) (:include entdef)
@ -889,7 +890,7 @@
(setf (entdef-extid def) (setf (entdef-extid def)
(absolute-extid source-stream (entdef-extid def)))) (absolute-extid source-stream (entdef-extid def))))
(setf (gethash name table) (setf (gethash name table)
(cons *markup-declaration-external-p* def))))) (cons *external-subset-p* def)))))
(defun get-entity-definition (entity-name kind dtd) (defun get-entity-definition (entity-name kind dtd)
(unless dtd (unless dtd
@ -913,6 +914,10 @@
(let (r) (let (r)
(etypecase def (etypecase def
(internal-entdef (internal-entdef
(when (and (standalone-p *ctx*)
(entdef-external-subset-p def))
(wf-error
"entity declared in external subset, but document is standalone"))
(setf r (make-rod-xstream (entdef-value def))) (setf r (make-rod-xstream (entdef-value def)))
(setf (xstream-name r) (setf (xstream-name r)
(make-stream-name :entity-name entity-name (make-stream-name :entity-name entity-name
@ -977,7 +982,7 @@
; (:ENUMERATION <name>*) ; (:ENUMERATION <name>*)
default ;default value of attribute: default ;default value of attribute:
; :REQUIRED, :IMPLIED, (:FIXED content) or (:DEFAULT content) ; :REQUIRED, :IMPLIED, (:FIXED content) or (:DEFAULT content)
(external-p *markup-declaration-external-p*) (external-p *external-subset-p*)
) )
(defstruct elmdef (defstruct elmdef
@ -986,7 +991,7 @@
content ;content model [*] content ;content model [*]
attributes ;list of defined attributes attributes ;list of defined attributes
compiled-cspec ;cons of validation function for contentspec compiled-cspec ;cons of validation function for contentspec
(external-p *markup-declaration-external-p*) (external-p *external-subset-p*)
) )
;; [*] in XML it is possible to define attributes before the element ;; [*] in XML it is possible to define attributes before the element
@ -1060,7 +1065,7 @@
(rod-string element-name))))))) (rod-string element-name)))))))
(sax:element-declaration (handler *ctx*) element-name content-model) (sax:element-declaration (handler *ctx*) element-name content-model)
(setf (elmdef-content e) content-model) (setf (elmdef-content e) content-model)
(setf (elmdef-external-p e) *markup-declaration-external-p*) (setf (elmdef-external-p e) *external-subset-p*)
e)))) e))))
(defvar *redefinition-warning* nil) (defvar *redefinition-warning* nil)
@ -1257,7 +1262,7 @@
((rune= #/? d) ((rune= #/? d)
(multiple-value-bind (target content) (read-pi input) (multiple-value-bind (target content) (read-pi input)
(cond ((rod= target '#.(string-rod "xml")) (cond ((rod= target '#.(string-rod "xml"))
(values :xml-pi (cons target content))) (values :xml-decl (cons target content)))
((rod-equal target '#.(string-rod "XML")) ((rod-equal target '#.(string-rod "XML"))
(wf-error "You lost -- no XML processing instructions.")) (wf-error "You lost -- no XML processing instructions."))
((and sax:*namespace-processing* (position #/: target)) ((and sax:*namespace-processing* (position #/: target))
@ -2348,7 +2353,7 @@
(:eof (return)) (:eof (return))
((:|<!ELEMENT| :|<!ATTLIST| :|<!ENTITY| :|<!NOTATION| :PI :COMMENT) ((:|<!ELEMENT| :|<!ATTLIST| :|<!ENTITY| :|<!NOTATION| :PI :COMMENT)
(let ((*expand-pe-p* t) (let ((*expand-pe-p* t)
(*markup-declaration-external-p* t)) (*external-subset-p* t))
(p/markup-decl input))) (p/markup-decl input)))
((:PE-REFERENCE) ((:PE-REFERENCE)
(let ((name (nth-value 1 (read-token input)))) (let ((name (nth-value 1 (read-token input))))
@ -2377,7 +2382,7 @@
;; | EntityDecl | NotationDecl ;; | EntityDecl | NotationDecl
;; | PI | Comment /* WFC: PEs in Internal Subset */ ;; | PI | Comment /* WFC: PEs in Internal Subset */
(let ((token (peek-token input)) (let ((token (peek-token input))
(*expand-pe-p* (and *expand-pe-p* *markup-declaration-external-p*))) (*expand-pe-p* (and *expand-pe-p* *external-subset-p*)))
(case token (case token
(:|<!ELEMENT| (p/element-decl input)) (:|<!ELEMENT| (p/element-decl input))
(:|<!ATTLIST| (p/attlist-decl input)) (:|<!ATTLIST| (p/attlist-decl input))
@ -2405,7 +2410,7 @@
(set-to-full-speed xstream)))) (set-to-full-speed xstream))))
(defun p/ext-subset (input) (defun p/ext-subset (input)
(cond ((eq (peek-token input) :xml-pi) (cond ((eq (peek-token input) :xml-decl)
(let ((hd (parse-text-decl (cdr (nth-value 1 (peek-token input)))))) (let ((hd (parse-text-decl (cdr (nth-value 1 (peek-token input))))))
(setup-encoding input hd)) (setup-encoding input hd))
(consume-token input))) (consume-token input)))
@ -2554,7 +2559,7 @@
;; we will use the attribute-value parser for the xml decl. ;; we will use the attribute-value parser for the xml decl.
(let ((*data-behaviour* :DTD)) (let ((*data-behaviour* :DTD))
;; optional XMLDecl? ;; optional XMLDecl?
(cond ((eq (peek-token input) :xml-pi) (cond ((eq (peek-token input) :xml-decl)
(let ((hd (parse-xml-decl (cdr (nth-value 1 (peek-token input)))))) (let ((hd (parse-xml-decl (cdr (nth-value 1 (peek-token input))))))
(setf (standalone-p *ctx*) (eq (xml-header-standalone-p hd) :yes)) (setf (standalone-p *ctx*) (eq (xml-header-standalone-p hd) :yes))
(setup-encoding input hd)) (setup-encoding input hd))
@ -2737,7 +2742,7 @@
(defun p/ext-parsed-ent (input) (defun p/ext-parsed-ent (input)
;; [78] extParsedEnt ::= '<?xml' VersionInfo? EncodingDecl S? '?>' content ;; [78] extParsedEnt ::= '<?xml' VersionInfo? EncodingDecl S? '?>' content
(when (eq (peek-token input) :xml-pi) (when (eq (peek-token input) :xml-decl)
(let ((hd (parse-text-decl (cdr (nth-value 1 (peek-token input)))))) (let ((hd (parse-text-decl (cdr (nth-value 1 (peek-token input))))))
(setup-encoding input hd)) (setup-encoding input hd))
(consume-token input)) (consume-token input))