cxml:unescaped, sax:unescaped

This commit is contained in:
dlichteblau
2007-11-18 18:43:10 +00:00
parent a50f1c7b64
commit 77db951f12
4 changed files with 55 additions and 0 deletions

23
dist.sh Executable file
View File

@ -0,0 +1,23 @@
#!/bin/sh
cd $(dirname $0)
home=$(pwd)
name=$(basename $home)
dir=${name}-$(date --iso)
TMPDIR=`mktemp -d /tmp/dist.XXXXXXXXXX`
cleanup() {
cd
rm -rf $TMPDIR
}
trap cleanup exit
cd $TMPDIR
cvs -d "`cat $home/CVS/Root`" export -r HEAD -d "$dir" "$name"
make -C $dir/doc
tgz=$TMPDIR/${dir}.tgz
tar czf $tgz $dir
gpg -b -a $tgz
mv $tgz $tgz.asc $home/

View File

@ -61,6 +61,9 @@
#:cdata
#:text
#:doctype
#:processing-instruction
#:comment
#:unescaped
#:xml-parse-error
#:well-formedness-violation

View File

@ -64,6 +64,7 @@
#:start-prefix-mapping
#:start-element
#:characters
#:unescaped
#:processing-instruction
#:end-element
#:end-prefix-mapping
@ -326,6 +327,10 @@ Setting this variable has no effect unless both
(data)
(hax:characters handler data))
(define-event (unescaped default-handler)
(data)
(hax:unescaped handler data))
(define-event (processing-instruction default-handler)
(target data)
nil)
@ -461,6 +466,9 @@ Setting this variable has no effect unless both
(defmethod hax:characters ((handler abstract-handler) data)
(sax:characters handler data))
(defmethod hax:unescaped ((handler abstract-handler) data)
(sax:unescaped handler data))
(defmethod hax:comment ((handler abstract-handler) str)
(sax:comment handler str))
@ -515,6 +523,9 @@ The data is passed as a rod, with all entity references resolved.
It is possible that the character content of an element is reported
via multiple subsequent calls to this generic function.")
(setf (documentation 'unescaped 'function)
"Called for unescaped element content. Beware dragons.")
(setf (documentation 'processing-instruction 'function)
"Called when a processing instruction is read.

View File

@ -459,6 +459,10 @@
(loop for c across data do (unparse-datachar c y))
(loop for c across data do (unparse-datachar-readable c y))))))))
(defmethod sax:unescaped ((sink sink) data)
(maybe-close-tag sink)
(%write-rod data sink))
(defmethod sax:comment ((sink sink) data)
(maybe-close-tag sink)
(unless (canonical sink)
@ -682,3 +686,17 @@
(maybe-emit-start-tag)
(sax:characters *sink* (rod data))
data)
(defun comment (data)
(maybe-emit-start-tag)
(sax:comment *sink* (rod data))
data)
(defun processing-instruction (target data)
(maybe-emit-start-tag)
(sax:processing-instruction *sink* (rod target) (rod data))
data)
(defun unescaped (str)
(maybe-emit-start-tag)
(sax:unescaped *sink* (rod str)))