Commit bf47a620 authored by david's avatar david

Revision: cxml--devel--1.0--patch-80

Archive: david@knowledgetools.de--cxml
Creator: David Lichteblau <david@knowledgetools.de>
Date: Fri Feb  6 23:49:58 CET 2004
Standard-date: 2004-02-06 22:49:58 GMT
Modified-files: xml/dom-builder.lisp xml/sax-handler.lisp
    xml/xml-parse.lisp
New-patches: david@knowledgetools.de--cxml/cxml--devel--1.0--patch-80
Summary: noch unfertig: initialisiere dom:enitities richtig, erzeuge Entity-Knoten

noch unfertig: initialisiere dom:enitities richtig, erzeuge Entity-Knoten
parent bd17380d
......@@ -41,7 +41,8 @@
(let ((document (document handler))
(doctype (make-instance 'dom-impl::document-type
:name name
:notations (make-hash-table :test #'equalp))))
:notations (make-instance 'dom-impl::named-node-map)
:entities (make-instance 'dom-impl::named-node-map))))
(setf (slot-value doctype 'dom-impl::owner) document
(slot-value document 'dom-impl::doc-type) doctype)))
......@@ -80,3 +81,12 @@
(parent (car element-stack)))
(setf (slot-value node 'dom-impl::parent) parent)
(push node (slot-value (car element-stack) 'dom-impl::children)))))
(defmethod sax:unparsed-entity-declaration
((handler dom-builder) name public-id system-id notation-name)
(dom:set-named-item (dom:entities (dom:doctype (document handler)))
(make-instance 'dom-impl::entity
:name name
:public-id public-id
:system-id system-id
:notation-name notation-name)))
......@@ -70,7 +70,8 @@
#:start-cdata
#:end-cdata
#:start-dtd
#:end-dtd))
#:end-dtd
#:unparsed-entity-declaration))
(in-package :sax)
......@@ -241,3 +242,11 @@ other textual content.")
(defgeneric end-dtd (handler)
(:documentation "Called at the end of parsing a DTD.")
(:method ((handler t)) nil))
(defgeneric unparsed-entity-declaration
(handler name public-id system-id notation-name)
(:documentation
"Called when an entity declaration is seen while parsing a DTD.")
(:method ((handler t) name public-id system-id notation-name)
(declare (ignore name public-id system-id notation-name))
nil))
......@@ -1567,6 +1567,15 @@
(p/S input)
(setf def (p/entity-def input kind))
(define-entity input name kind def)
(when (eq kind :general)
;; XXX wirklich nur :general?
;; XXX was ist mit notation-name?
(ecase (car def)
(:EXTERNAL
;; XXX hier fehlen public-id und system-id
(sax:unparsed-entity-declaration *handler* name nil nil nil))
(:INTERNAL
(sax:unparsed-entity-declaration *handler* name nil nil nil))))
(p/S? input)
(expect input :\>)))
......@@ -1883,6 +1892,9 @@
(eq (peek-token input) :\> ))
(setf extid (p/external-id input t))))
(p/S? input)
(ecase (car extid)
(:PUBLIC (sax:start-dtd *handler* name (cadr extid) (caddr extid)))
(:SYSTEM (sax:start-dtd *handler* name nil (cadr extid))))
(when (eq (peek-token input) :\[ )
(consume-token input)
(while (progn (p/S? input)
......@@ -1902,9 +1914,6 @@
(consume-token input)
(p/S? input))
(expect input :>)
(ecase (car extid)
(:PUBLIC (sax:start-dtd *handler* name (cadr extid) (caddr extid)))
(:SYSTEM (sax:start-dtd *handler* name nil (cadr extid))))
(when extid
(let* ((xi2 (open-extid (absolute-extid input extid)))
(zi2 (make-zstream :input-stack (list xi2))))
......
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