+ <li>Gilbert Baumann has clarified the license as Lisp-LGPL.</li>
This commit is contained in:
@ -1,3 +1,11 @@
|
||||
;;;; dom-sax.lisp -- DOM walker
|
||||
;;;;
|
||||
;;;; This file is part of the CXML parser, released under Lisp-LGPL.
|
||||
;;;; See file COPYING for details.
|
||||
;;;;
|
||||
;;;; Author: David Lichteblau <david@lichteblau.com>
|
||||
;;;; Copyright (c) 2004 knowledgeTools Int. GmbH
|
||||
|
||||
(in-package :dom-impl)
|
||||
|
||||
(defun dom:map-document
|
||||
@ -8,15 +16,20 @@
|
||||
(let ((doctype (dom:doctype document)))
|
||||
(when doctype
|
||||
(sax:start-dtd handler (dom:name doctype) nil nil)
|
||||
(let ((ns (dom:notations doctype)))
|
||||
;; need notations for canonical mode 2
|
||||
(let* ((ns (dom:notations doctype))
|
||||
(a (make-array (dom:length ns))))
|
||||
;; get them
|
||||
(dotimes (k (dom:length ns))
|
||||
(let ((n (dom:item ns k)))
|
||||
(sax:notation-declaration handler
|
||||
(dom:name n)
|
||||
(dom:public-id n)
|
||||
(dom:system-id n)))
|
||||
;; fixme: entities!
|
||||
)
|
||||
(setf (elt a k) (dom:item ns k)))
|
||||
;; sort them
|
||||
(setf a (sort a #'rod< :key #'dom:name))
|
||||
(loop for n across a do
|
||||
(sax:notation-declaration handler
|
||||
(dom:name n)
|
||||
(dom:public-id n)
|
||||
(dom:system-id n)))
|
||||
;; fixme: entities!
|
||||
(sax:end-dtd handler))))
|
||||
(labels ((walk (node)
|
||||
(dom:do-node-list (child (dom:child-nodes node))
|
||||
@ -53,8 +66,8 @@
|
||||
(when (and (or defaultp (dom:specified a))
|
||||
(or xmlnsp (not (cxml::xmlns-attr-p (dom:name a)))))
|
||||
(push
|
||||
(cxml::make-attribute :qname (dom:name a)
|
||||
:value (dom:value a)
|
||||
:specified-p (dom:specified a))
|
||||
(sax:make-attribute :qname (dom:name a)
|
||||
:value (dom:value a)
|
||||
:specified-p (dom:specified a))
|
||||
results)))
|
||||
(reverse results)))
|
||||
|
||||
Reference in New Issue
Block a user