From ab0a676042e9508cb90d7689f0f6d4ab465dbcaf Mon Sep 17 00:00:00 2001 From: dlichteblau Date: Sun, 27 Nov 2005 18:41:06 +0000 Subject: [PATCH] -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. - ] --- XMLCONF | 25 ++++--------------------- xml/package.lisp | 2 +- xml/xml-parse.lisp | 31 ++++++++++++++++++------------- 3 files changed, 23 insertions(+), 35 deletions(-) diff --git a/XMLCONF b/XMLCONF index aa72bf1..7f0ad1d 100644 --- a/XMLCONF +++ b/XMLCONF @@ -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 \ No newline at end of file +10/1786 tests failed; 376 tests were skipped \ No newline at end of file diff --git a/xml/package.lisp b/xml/package.lisp index a75ff32..ae96013 100644 --- a/xml/package.lisp +++ b/xml/package.lisp @@ -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 diff --git a/xml/xml-parse.lisp b/xml/xml-parse.lisp index 01f9f8e..8455160 100644 --- a/xml/xml-parse.lisp +++ b/xml/xml-parse.lisp @@ -62,7 +62,7 @@ ;; slot of zstreams instead). ;; Common -;; :xml-pi ( . ) ;processing-instruction starting with " . ) ;processing-instruction starting with " . ) ;processing-instruction ;; :stag ( . ) ;start tag ;; :etag ( . ) ;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 *) 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)) ((:|' 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))