whitespace normalizer

This commit is contained in:
dlichteblau
2005-12-29 00:31:30 +00:00
parent 4df5d1d054
commit b0615afdd9
14 changed files with 135 additions and 11 deletions

View File

@ -53,6 +53,8 @@
#:*use-xmlns-namespace*
#:make-attribute
#:find-attribute
#:find-attribute-ns
#:attribute-namespace-uri
#:attribute-local-name
#:attribute-qname
@ -137,6 +139,23 @@ Setting this variable has no effect unless both
value
specified-p)
(defun %rod= (x y)
;; allow rods *and* strings *and* null
(cond
((zerop (length x)) (zerop (length y)))
((zerop (length y)) nil)
((stringp x) (string= x y))
(t (runes:rod= x y))))
(defun find-attribute (qname attrs)
(find qname attrs :key #'attribute-qname :test #'%rod=))
(defun find-attribute-ns (uri lname attrs)
(find-if (lambda (attr)
(and (%rod= uri (sax:attribute-namespace-uri attr))
(%rod= lname (sax:attribute-local-name attr))))
attrs))
(defgeneric start-document (handler)
(:documentation "Called at the beginning of the parsing process,
before any element, processing instruction or comment is reported.
@ -325,7 +344,11 @@ finished, if present.")
(:documentation
"Called between sax:end-dtd and sax:end-document to register an entity
resolver, a function of two arguments: An entity name and SAX handler.
When called, the resolver function will parse the named entities data.")
When called, the resolver function will parse the named entity's data.")
(:method ((handler t) resolver)
(declare (ignore resolver))
nil))
;; internal for now
(defgeneric dtd (handler dtd)
(:method ((handler t) dtd) (declare (ignore dtd)) nil))