- 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:
@ -72,8 +72,13 @@
|
||||
#:make-octet-stream-ystream
|
||||
#:make-rod-ystream
|
||||
#+rune-is-character #:make-character-stream-ystream
|
||||
#+rune-is-integer #:make-string-ystream/utf8
|
||||
#+rune-is-integer #:make-character-stream-ystream/utf8
|
||||
;; These don't make too much sense on Unicode-enabled,
|
||||
;; implementations but for those applications using them anyway,
|
||||
;; I have commented out the reader conditionals now:
|
||||
;; #+rune-is-integer
|
||||
#:make-string-ystream/utf8
|
||||
;; #+rune-is-integer
|
||||
#:make-character-stream-ystream/utf8
|
||||
#:runes-to-utf8/adjustable-string))
|
||||
|
||||
(defpackage :utf8-runes
|
||||
|
||||
@ -222,7 +222,7 @@
|
||||
|
||||
;;;; CHARACTER-STREAM-YSTREAM/UTF8
|
||||
|
||||
#+rune-is-integer
|
||||
;; #+rune-is-integer
|
||||
(progn
|
||||
(defstruct (character-stream-ystream/utf8
|
||||
(:constructor make-character-stream-ystream/utf8 (os-stream))
|
||||
@ -239,7 +239,7 @@
|
||||
|
||||
;;;; STRING-YSTREAM/UTF8
|
||||
|
||||
#+rune-is-integer
|
||||
;; #+rune-is-integer
|
||||
(progn
|
||||
(defstruct (string-ystream/utf8
|
||||
(:include character-stream-ystream/utf8
|
||||
|
||||
@ -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