diff --git a/DOMTEST b/DOMTEST index 5ac7d16..8bb0229 100644 --- a/DOMTEST +++ b/DOMTEST @@ -552,22 +552,14 @@ implementationAttribute signed not supported, skipping test #P"/home/david/2001/DOM-Test-Suite/tests/level2/core/" 524/808 attrgetownerelement01.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 525/808 attrgetownerelement02.xml 526/808 attrgetownerelement03.xml 527/808 attrgetownerelement04.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (# NIL T). +TEST FAILED: The slot DOM-IMPL::OWNER-ELEMENT is unbound in the object #. 528/808 attrgetownerelement05.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). +TEST FAILED: The assertion (DOMTEST::EQUALSP DOMTEST-TESTS::|ownerElementName| + #(97 100 100 114 101 115 115) + 'DOMTEST::%EQUAL) failed. 529/808 createAttributeNS01.xml 530/808 createAttributeNS02.xml TEST FAILED: expected exception NAMESPACE_ERR @@ -629,10 +621,6 @@ TEST FAILED: The assertion (EQL (LENGTH DOMTEST::COLLECTION) 6) failed. 568/808 documentgetelementsbytagnameNS05.xml 569/808 documentimportnode01.xml 570/808 documentimportnode02.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (# NIL NIL). 571/808 documentimportnode03.xml 572/808 documentimportnode04.xml 573/808 documentimportnode05.xml @@ -695,28 +683,11 @@ TEST FAILED: The assertion DOMTEST-TESTS::|state| failed. TEST FAILED: The assertion DOMTEST-TESTS::|success| failed. 603/808 domimplementationhasfeature02.xml 604/808 elementgetattributenodens01.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 605/808 elementgetattributenodens02.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 606/808 elementgetattributenodens03.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 607/808 elementgetattributens02.xml -TEST FAILED: The assertion (DOMTEST::EQUALSP DOMTEST-TESTS::|attrValue| - #(100 101 102 97 117 108 116 86 97 - 108) - 'DOMTEST::%EQUAL) failed. 608/808 elementgetelementsbytagnamens02.xml 609/808 elementgetelementsbytagnamens04.xml -TEST FAILED: The assertion (EQL (LENGTH DOMTEST::COLLECTION) 1) failed. 610/808 elementgetelementsbytagnamens05.xml 611/808 elementhasattribute01.xml 612/808 elementhasattribute02.xml @@ -725,38 +696,18 @@ TEST FAILED: The assertion (EQL (LENGTH DOMTEST::COLLECTION) 1) failed. 615/808 elementhasattributens01.xml TEST FAILED: The assertion DOMTEST-TESTS::|state| failed. 616/808 elementhasattributens02.xml -TEST FAILED: The assertion DOMTEST-TESTS::|state| failed. 617/808 elementhasattributens03.xml -TEST FAILED: The assertion DOMTEST-TESTS::|state| failed. 618/808 elementremoveattributens01.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (# NIL). 619/808 elementsetattributenodens01.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 620/808 elementsetattributenodens02.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL T). +TEST FAILED: The slot DOM-IMPL::NAMESPACE-URI is unbound in the object #. 621/808 elementsetattributenodens03.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (# NIL). +TEST FAILED: expected exception INUSE_ATTRIBUTE_ERR 622/808 elementsetattributenodens04.xml 623/808 elementsetattributenodens05.xml 624/808 elementsetattributenodens06.xml implementationAttribute expandEntityReferences not supported, skipping test 625/808 elementsetattributens01.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 626/808 elementsetattributens02.xml TEST FAILED: There is no applicable method for the generic function # @@ -768,10 +719,6 @@ TEST FAILED: There is no applicable method for the generic function #(116 104 105 115 58 115 116 114 101 101 116) #(83 105 108 118 101 114 32 83 116 114 101 101 116)). 627/808 elementsetattributens03.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 628/808 elementsetattributens04.xml 629/808 elementsetattributens05.xml TEST FAILED: expected exception NAMESPACE_ERR @@ -780,29 +727,12 @@ TEST FAILED: expected exception NAMESPACE_ERR 631/808 elementsetattributensurinull.xml TEST FAILED: expected exception NAMESPACE_ERR 632/808 getAttributeNS01.xml -TEST FAILED: The assertion (DOMTEST::EQUALSP DOMTEST-TESTS::|attrValue| - #(68 73 83 84 82 73 67 84) - 'DOMTEST::%EQUAL) failed. 633/808 getAttributeNS02.xml 634/808 getAttributeNS03.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (# NIL). 635/808 getAttributeNS04.xml -TEST FAILED: The assertion (DOMTEST::EQUALSP DOMTEST-TESTS::|attrValue| - #(78 101 119 86 97 108 117 101) - 'DOMTEST::%EQUAL) failed. 636/808 getAttributeNS05.xml -TEST FAILED: The assertion (DOMTEST::EQUALSP DOMTEST-TESTS::|attrValue| - #(89 101 115) - 'DOMTEST::%EQUAL) failed. 637/808 getAttributeNodeNS01.xml 638/808 getAttributeNodeNS02.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 639/808 getElementById01.xml TEST FAILED: There is no applicable method for the generic function # @@ -826,10 +756,6 @@ TEST FAILED: The assertion (EQL (LENGTH DOMTEST::COLLECTION) 5) failed. 653/808 getElementsByTagNameNS13.xml 654/808 getElementsByTagNameNS14.xml 655/808 getNamedItemNS01.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 656/808 getNamedItemNS02.xml 657/808 getNamedItemNS03.xml 658/808 getNamedItemNS04.xml @@ -841,9 +767,7 @@ TEST FAILED: There is no applicable method for the generic function 664/808 hasAttributeNS02.xml 665/808 hasAttributeNS03.xml 666/808 hasAttributeNS04.xml -TEST FAILED: The assertion DOMTEST-TESTS::|state| failed. 667/808 hasAttributeNS05.xml -TEST FAILED: The assertion DOMTEST-TESTS::|state| failed. 668/808 hasAttributes01.xml 669/808 hasAttributes02.xml 670/808 hc_entitiesremovenameditemns1.xml @@ -907,26 +831,10 @@ TEST FAILED: The assertion DOMTEST-TESTS::|state| failed. 710/808 localName04.xml 711/808 namednodemapgetnameditemns01.xml 712/808 namednodemapgetnameditemns02.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 713/808 namednodemapgetnameditemns03.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 714/808 namednodemapgetnameditemns04.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 715/808 namednodemapgetnameditemns05.xml 716/808 namednodemapgetnameditemns06.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 717/808 namednodemapremovenameditemns01.xml 718/808 namednodemapremovenameditemns02.xml TEST FAILED: There is no applicable method for the generic function @@ -934,10 +842,6 @@ TEST FAILED: There is no applicable method for the generic function when called with arguments (NIL). 719/808 namednodemapremovenameditemns03.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 720/808 namednodemapremovenameditemns04.xml TEST FAILED: NOT_FOUND_ERR (8): #(120 109 108 110 115) not found in # @@ -945,61 +849,27 @@ TEST FAILED: NOT_FOUND_ERR (8): 722/808 namednodemapremovenameditemns06.xml 723/808 namednodemapremovenameditemns07.xml 724/808 namednodemapremovenameditemns08.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (# NIL). 725/808 namednodemapremovenameditemns09.xml 726/808 namednodemapsetnameditemns01.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 727/808 namednodemapsetnameditemns02.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 728/808 namednodemapsetnameditemns03.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 729/808 namednodemapsetnameditemns04.xml 730/808 namednodemapsetnameditemns05.xml 731/808 namednodemapsetnameditemns06.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). +TEST FAILED: expected exception INUSE_ATTRIBUTE_ERR 732/808 namednodemapsetnameditemns07.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). +TEST FAILED: expected exception INUSE_ATTRIBUTE_ERR 733/808 namednodemapsetnameditemns08.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). +TEST FAILED: expected exception INUSE_ATTRIBUTE_ERR 734/808 namednodemapsetnameditemns09.xml 735/808 namednodemapsetnameditemns10.xml 736/808 namednodemapsetnameditemns11.xml 737/808 namespaceURI01.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 738/808 namespaceURI02.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 739/808 namespaceURI03.xml 740/808 namespaceURI04.xml 741/808 nodegetlocalname03.xml 742/808 nodegetnamespaceuri03.xml -TEST FAILED: The assertion (NULL DOMTEST-TESTS::|attrNSURINull|) failed. 743/808 nodegetownerdocument01.xml 744/808 nodegetownerdocument02.xml 745/808 nodegetprefix03.xml @@ -1027,17 +897,14 @@ TEST FAILED: The assertion (DOMTEST::EQUALSP DOMTEST-TESTS::|elementTagName| 114 101 115 115) 'DOMTEST::%EQUAL) failed. 757/808 nodesetprefix02.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). +TEST FAILED: The assertion (DOMTEST::EQUALSP DOMTEST-TESTS::|newAttrName| + #(100 111 109 58 97 100 100 114 + 101 115 115) + 'DOMTEST::%EQUAL) failed. 758/808 nodesetprefix03.xml TEST FAILED: expected exception NAMESPACE_ERR 759/808 nodesetprefix04.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (#(116 101 115 116) NIL). +TEST FAILED: expected exception NAMESPACE_ERR 760/808 nodesetprefix05.xml 761/808 nodesetprefix06.xml 762/808 nodesetprefix07.xml @@ -1064,9 +931,9 @@ TEST FAILED: expected exception NAMESPACE_ERR 781/808 removeAttributeNS01.xml 782/808 removeAttributeNS02.xml TEST FAILED: There is no applicable method for the generic function - # + # when called with arguments - (# NIL). + (NIL). 783/808 removeNamedItemNS01.xml 784/808 removeNamedItemNS02.xml 785/808 removeNamedItemNS03.xml @@ -1074,21 +941,11 @@ TEST FAILED: There is no applicable method for the generic function 787/808 setAttributeNS02.xml 788/808 setAttributeNS03.xml 789/808 setAttributeNS04.xml -TEST FAILED: The assertion (DOMTEST::EQUALSP DOMTEST-TESTS::|resultAttr| - #(110 101 119 86 97 108 117 101) - 'DOMTEST::%EQUAL) failed. 790/808 setAttributeNS05.xml -TEST FAILED: The assertion (DOMTEST::EQUALSP DOMTEST-TESTS::|resultAttr| - #(60 110 101 119 86 97 108 117 101 - 62) - 'DOMTEST::%EQUAL) failed. 791/808 setAttributeNS06.xml 792/808 setAttributeNS07.xml TEST FAILED: expected exception NAMESPACE_ERR 793/808 setAttributeNS09.xml -TEST FAILED: The assertion (DOMTEST::EQUALSP DOMTEST-TESTS::|resultAttr| - #(110 101 119 86 97 108 117 101) - 'DOMTEST::%EQUAL) failed. 794/808 setAttributeNS10.xml 795/808 setAttributeNodeNS01.xml 796/808 setAttributeNodeNS02.xml @@ -1097,21 +954,10 @@ implementationAttribute expandEntityReferences not supported, skipping test 798/808 setAttributeNodeNS04.xml 799/808 setAttributeNodeNS05.xml 800/808 setNamedItemNS01.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). +TEST FAILED: expected exception INUSE_ATTRIBUTE_ERR 801/808 setNamedItemNS02.xml 802/808 setNamedItemNS03.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 803/808 setNamedItemNS04.xml -TEST FAILED: There is no applicable method for the generic function - # - when called with arguments - (NIL). 804/808 setNamedItemNS05.xml 805/808 systemId01.xml -101/763 tests failed; 45 tests were skipped \ No newline at end of file +63/763 tests failed; 45 tests were skipped \ No newline at end of file diff --git a/dom/dom-impl.lisp b/dom/dom-impl.lisp index 4b01030..ffab78c 100644 --- a/dom/dom-impl.lisp +++ b/dom/dom-impl.lisp @@ -128,6 +128,12 @@ ;;; Implementation +(defun %rod (x) + (etypecase x + (null x) + (rod x) + (string (string-rod x)))) + (defun assert-writeable (node) (when (read-only-p node) (dom-error :NO_MODIFICATION_ALLOWED_ERR "~S is marked read-only." node))) @@ -251,7 +257,7 @@ (return k))))) (defmethod dom:create-element ((document document) tag-name) - (setf tag-name (rod tag-name)) + (setf tag-name (%rod tag-name)) (unless (cxml::valid-name-p tag-name) (dom-error :INVALID_CHARACTER_ERR "not a name: ~A" (rod-string tag-name))) (let ((result (make-instance 'element @@ -286,7 +292,7 @@ (values prefix local-name))) (defmethod dom:create-element-ns ((document document) uri qname) - (setf qname (rod qname)) + (setf qname (%rod qname)) (multiple-value-bind (prefix local-name) (safe-split-qname qname uri) (let ((result (make-instance 'element @@ -308,26 +314,26 @@ :owner document)) (defmethod dom:create-text-node ((document document) data) - (setf data (rod data)) + (setf data (%rod data)) (make-instance 'text :data data :owner document)) (defmethod dom:create-comment ((document document) data) - (setf data (rod data)) + (setf data (%rod data)) (make-instance 'comment :data data :owner document)) (defmethod dom:create-cdata-section ((document document) data) - (setf data (rod data)) + (setf data (%rod data)) (make-instance 'cdata-section :data data :owner document)) (defmethod dom:create-processing-instruction ((document document) target data) - (setf target (rod target)) - (setf data (rod data)) + (setf target (%rod target)) + (setf data (%rod data)) (unless (cxml::valid-name-p target) (dom-error :INVALID_CHARACTER_ERR "not a name: ~A" (rod-string target))) (make-instance 'processing-instruction @@ -336,7 +342,7 @@ :data data)) (defmethod dom:create-attribute ((document document) name) - (setf name (rod name)) + (setf name (%rod name)) (unless (cxml::valid-name-p name) (dom-error :INVALID_CHARACTER_ERR "not a name: ~A" (rod-string name))) (make-instance 'attribute @@ -349,8 +355,8 @@ :owner document)) (defmethod dom:create-attribute-ns ((document document) uri qname) - (setf uri (rod uri)) - (setf qname (rod qname)) + (setf uri (%rod uri)) + (setf qname (%rod qname)) (multiple-value-bind (prefix local-name) (safe-split-qname qname uri) (make-instance 'attribute @@ -363,7 +369,7 @@ :owner document))) (defmethod dom:create-entity-reference ((document document) name) - (setf name (rod name)) + (setf name (%rod name)) (unless (cxml::valid-name-p name) (dom-error :INVALID_CHARACTER_ERR "not a name: ~A" (rod-string name))) (make-instance 'entity-reference @@ -371,7 +377,7 @@ :owner document)) (defmethod get-elements-by-tag-name-internal (node tag-name) - (setf tag-name (rod tag-name)) + (setf tag-name (%rod tag-name)) (let ((result (make-node-list)) (wild-p (rod= tag-name #"*"))) (labels ((walk (n) @@ -384,8 +390,8 @@ result)) (defmethod get-elements-by-tag-name-internal-ns (node uri lname) - (setf uri (rod uri)) - (setf lname (rod lname)) + (setf uri (%rod uri)) + (setf lname (%rod lname)) (let ((result (make-node-list)) (wild-uri-p (rod= uri #"*")) (wild-lname-p (rod= lname #"*"))) @@ -409,7 +415,7 @@ (block nil (unless (dtd document) (return nil)) - (setf id (rod id)) + (setf id (%rod id)) (labels ((walk (n) (dovector (c (dom:child-nodes n)) (when (dom:element-p c) @@ -703,19 +709,19 @@ ;;; NAMED-NODE-MAP (defmethod dom:get-named-item ((self named-node-map) name) - (setf name (rod name)) + (setf name (%rod name)) (with-slots (items) self (dolist (k items nil) (when (rod= name (dom:node-name k)) (return k))))) (defmethod dom:get-named-item-ns ((self named-node-map) uri lname) - (setf uri (rod uri)) - (setf lname (rod lname)) + (setf uri (%rod uri)) + (setf lname (%rod lname)) (with-slots (items) self (dolist (k items nil) - (when (and (equal uri (dom:namespace-uri k)) - (equal lname (dom:local-name k))) + (when (and (rod= uri (dom:namespace-uri k)) + (rod= lname (dom:local-name k))) (return k))))) (defun %set-named-item (map arg test) @@ -753,7 +759,7 @@ (defmethod dom:remove-named-item ((self named-node-map) name) (assert-writeable self) - (setf name (rod name)) + (setf name (%rod name)) (with-slots (items) self (dolist (k items (dom-error :NOT_FOUND_ERR "~A not found in ~A" name self)) (cond ((rod= name (dom:node-name k)) @@ -762,8 +768,8 @@ (defmethod dom:remove-named-item-ns ((self named-node-map) uri lname) (assert-writeable self) - (setf uri (rod uri)) - (setf lname (rod lname)) + (setf uri (%rod uri)) + (setf lname (%rod lname)) (with-slots (items) self (dolist (k items (dom-error :NOT_FOUND_ERR "~A not found in ~A" lname self)) @@ -786,7 +792,7 @@ (defmethod (setf dom:data) (newval (self character-data)) (assert-writeable self) - (setf newval (rod newval)) + (setf newval (%rod newval)) (setf (slot-value self 'value) newval)) (defmethod dom:length ((node character-data)) @@ -801,7 +807,7 @@ (defmethod dom:append-data ((node character-data) arg) (assert-writeable node) - (setq arg (rod arg)) + (setq arg (%rod arg)) (with-slots (value) node (setf value (concatenate 'rod value arg))) (values)) @@ -829,7 +835,7 @@ ;; Although we could implement this by calling DELETE-DATA, then INSERT-DATA, ;; we implement this function directly to avoid creating temporary garbage. (assert-writeable node) - (setf arg (rod arg)) + (setf arg (%rod arg)) (with-slots (value) node (unless (<= 0 offset (length value)) (dom-error :INDEX_SIZE_ERR "offset is invalid")) @@ -852,7 +858,7 @@ (defmethod dom:insert-data ((node character-data) offset arg) (assert-writeable node) - (setf arg (rod arg)) + (setf arg (%rod arg)) (with-slots (value) node (unless (<= 0 offset (length value)) (dom-error :INDEX_SIZE_ERR "offset is invalid")) @@ -889,7 +895,7 @@ (defmethod (setf dom:value) (new-value (node attribute)) (assert-writeable node) - (let ((rod (rod new-value))) + (let ((rod (%rod new-value))) (with-slots (children owner) node ;; remove children, add new TEXT-NODE child ;; (alas, we must not reuse an old TEXT-NODE) @@ -1147,7 +1153,7 @@ (defmethod (setf dom:data) (newval (self processing-instruction)) (assert-writeable self) - (setf newval (rod newval)) + (setf newval (%rod newval)) (setf (slot-value self 'data) newval)) ;; das koennte man auch mit einer GF machen