Commit 12f16661 authored by david's avatar david

Revision: cxml--devel--1.0--patch-70

Archive: david@knowledgetools.de--cxml
Creator: David Lichteblau <david@knowledgetools.de>
Date: Fri Feb  6 18:48:43 CET 2004
Standard-date: 2004-02-06 17:48:43 GMT
Modified-files: xml/dom-impl.lisp
New-patches: david@knowledgetools.de--cxml/cxml--devel--1.0--patch-70
Summary: fixed patch-69: signal INUSE_ATTRIBUTE_ERR in set-named-item, not in set-attribute-node

fixed patch-69: signal INUSE_ATTRIBUTE_ERR in set-named-item, not in set-attribute-node
parent 7d78f8da
......@@ -38,7 +38,7 @@
((name :initarg :name :reader dom:name)
(value :initarg :value :reader dom:value)
(specified-p :initarg :specified-p :reader dom:specified)
(element :initform nil)))
(map :initform nil)))
(defmethod print-object ((object attribute) stream)
(print-unreadable-object (object stream :type t :identity t)
......@@ -428,6 +428,10 @@
(return k))))))
(defmethod dom:set-named-item ((self named-node-map) arg)
(let ((old-map (slot-value arg 'map)))
(when (and old-map (not (eq old-map self)))
(dom-error :INUSE_ATTRIBUTE_ERR "Attribute node already mapped" arg)))
(setf (slot-value arg 'map) self)
(let ((name (dom:node-name arg)))
(with-slots (items) self
(dolist (k items (progn (setf items (cons arg items))nil))
......@@ -549,11 +553,6 @@
(defmethod dom:set-attribute-node ((element element) (new-attr attribute))
(assert-writeable element)
(let ((old-element (slot-value new-attr 'element)))
(when (and old-element (not (eq old-element element)))
(dom-error :INUSE_ATTRIBUTE_ERR "Attribute node already has an element"
new-attr)))
(setf (slot-value new-attr 'element) element)
(dom:set-named-item (dom:attributes element) new-attr))
(defmethod dom:get-attribute ((element element) name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment