Commit 0b2b75ec authored by david's avatar david

Revision: cxml--devel--1.0--patch-25

Archive: david@knowledgetools.de--cxml
Creator: David Lichteblau <david@knowledgetools.de>
Date: Fri Jan 23 18:25:56 CET 2004
Standard-date: 2004-01-23 17:25:56 GMT
Modified-files: xml/dom-impl.lisp
New-patches: david@knowledgetools.de--cxml/cxml--devel--1.0--patch-25
Summary: dom:normalize implementiert
parent a897b418
......@@ -472,7 +472,23 @@
(error "Not implemented."))
(defmethod dom:normalize ((element element))
(error "Not implemented.") )
(labels ((walk (n)
(let ((previous nil))
(dolist (child (dom:child-nodes n))
(cond
((not (dom:text-node-p child))
(setf previous nil))
((and previous (dom:text-node-p previous))
(setf (slot-value previous 'data)
(concatenate 'vector
(dom:data previous)
(dom:data child)))
(dom:remove-child n child))
(t
(setf previous child)))))
(mapc #'walk (dom:child-nodes n))))
(walk element))
(values))
;;; TEXT
......
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