Commit 1753f9c3 authored by david's avatar david

Revision: cxml--devel--1.0--patch-95

Archive: david@knowledgetools.de--cxml
Creator: David Lichteblau <david@knowledgetools.de>
Date: Mon Feb  9 16:30:34 CET 2004
Standard-date: 2004-02-09 15:30:34 GMT
Modified-files: xml/dom-impl.lisp
New-patches: david@knowledgetools.de--cxml/cxml--devel--1.0--patch-95
Summary: ENSURE-VALID-INSERTION-REQUEST korrigiert
Keywords:

In ENSURE-VALID-INSERTION-REQUEST ist zu pruefen, dass kein zyklische
bzw. nicht zusammenhaengende Graph entstehen wuerde, sonst gibt es einen
HIERARCHY_REQUEST_ERR.

Zweitens muss der Kinderknoten ausgehaengt werden, falls es schon in
Verwendung ist.  Und zwar aus beliebigen Knoten.

GB_INTEGRITY_ERR war so meines Verstaendnisses nach so nicht richtig,
es entfaellt hiermit.
parent d09d5c61
......@@ -247,16 +247,14 @@
(dom-error :WRONG_DOCUMENT_ERR
"~S cannot adopt ~S, since it was created by a different document."
node new-child))
(with-slots (children) node
(unless (null (slot-value new-child 'parent))
(cond ((eq (slot-value new-child 'parent)
node)
;; remove it first
(setf children (delete new-child children)))
(t
;; otherwise it is an error.
(dom-error :GB_INTEGRITY_ERR "~S is already adopted."
new-child)))) ))
(do ((n node (dom:parent-node n)))
((null n))
(when (eq n new-child)
(dom-error :HIERARCHY_REQUEST_ERR
"~S cannot adopt ~S, since that would create a cycle"
node new-child)))
(unless (null (slot-value new-child 'parent))
(dom:remove-child (slot-value new-child 'parent) new-child)))
(defmethod dom:insert-before ((node node) (new-child node) (ref-child t))
(ensure-valid-insertion-request node new-child)
......
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