-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/utf16l.xml [not validating:] input [validating:] invalid
sun/invalid/empty.xml [not validating:] input [validating:] invalid
sun/not-wf/not-sa03.xml [not validating:] FAILED:
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/not-sa03.xml [not validating:] not-wf [validating:] invalid
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/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
after the key word "yes" in the SDDecl in the XMLDecl.
]
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.
]
ibm/not-wf/P32/ibm32n09.xml [not validating:] not-wf [validating:] invalid
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/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/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/ibm68n06.xml [not validating:] FAILED:
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/ibm68n06.xml [not validating:] not-wf [validating:] invalid
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/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/P88/ibm88v01.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)
(defpackage :cxml
(:use :cl :runes :encoding :trivial-gray-streams)
(:use :cl :runes :runes-encoding :trivial-gray-streams)
(:export
;; xstreams
#:make-xstream

View File

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