- Define CXML:ATTRIBUTE as a generic function, and a method for integers.
- Define /UTF8 sinks even on Unicode-aware implementations for backward- compatibility. (Undocumented feature.)
This commit is contained in:
@ -43,8 +43,11 @@
|
||||
#:make-rod-sink
|
||||
#+rune-is-character #:make-string-sink
|
||||
#+rune-is-character #:make-character-stream-sink
|
||||
#-rune-is-character #:make-string-sink/utf8
|
||||
#-rune-is-character #:make-character-stream-sink/utf8
|
||||
;; See comment in runes/package.lisp
|
||||
;; #-rune-is-character
|
||||
#:make-string-sink/utf8
|
||||
;; #-rune-is-character
|
||||
#:make-character-stream-sink/utf8
|
||||
|
||||
#:with-xml-output
|
||||
#:with-element
|
||||
|
||||
@ -95,8 +95,8 @@
|
||||
:adjustable t
|
||||
:fill-pointer 0))
|
||||
|
||||
;; total haesslich, aber die ystreams will ich im moment eigentlich nicht
|
||||
;; dokumentieren
|
||||
;; bisschen unschoen hier die ganze api zu duplizieren, aber die
|
||||
;; ystreams sind noch undokumentiert
|
||||
(macrolet ((define-maker (make-sink make-ystream &rest args)
|
||||
`(defun ,make-sink (,@args &rest initargs)
|
||||
(apply #'make-instance
|
||||
@ -110,10 +110,10 @@
|
||||
#+rune-is-character
|
||||
(define-maker make-character-stream-sink make-character-stream-ystream stream)
|
||||
|
||||
#-rune-is-character
|
||||
;; #-rune-is-character
|
||||
(define-maker make-string-sink/utf8 make-string-ystream/utf8)
|
||||
|
||||
#-rune-is-character
|
||||
;; #-rune-is-character
|
||||
(define-maker make-character-stream-sink/utf8
|
||||
make-character-stream-ystream/utf8
|
||||
stream))
|
||||
@ -539,11 +539,22 @@
|
||||
(maybe-emit-start-tag)
|
||||
(sax:end-element *sink* nil nil qname))))
|
||||
|
||||
(defun attribute (name value)
|
||||
(defun attribute-1 (name value)
|
||||
(push (sax:make-attribute :qname (rod name) :value (rod value))
|
||||
(cdr *current-element*))
|
||||
value)
|
||||
|
||||
(defgeneric attribute (name value))
|
||||
|
||||
(defmethod attribute (name (value string))
|
||||
(attribute-1 name value))
|
||||
|
||||
(defmethod attribute (name (value null))
|
||||
(declare (ignore name)))
|
||||
|
||||
(defmethod attribute (name (value integer))
|
||||
(attribute-1 name (write-to-string value)))
|
||||
|
||||
(defun cdata (data)
|
||||
(maybe-emit-start-tag)
|
||||
(sax:start-cdata *sink*)
|
||||
|
||||
Reference in New Issue
Block a user