From b68b3b9b2eddf7a8ae0a784ecc08a9ce15082a74 Mon Sep 17 00:00:00 2001 From: David Lichteblau Date: Fri, 7 Dec 2007 14:06:23 +0100 Subject: [PATCH] Ivan's patch: literal attributes and for-each. Removed the compilation of literal attribute bodies -- always expect a single string there. Attribute value templates still to be done. Fix to for-each included as-is. --- instructions.lisp | 18 +++++++----------- 1 file changed, 7 insertions(+), 11 deletions(-) diff --git a/instructions.lisp b/instructions.lisp index eb87b06..2a3b460 100644 --- a/instructions.lisp +++ b/instructions.lisp @@ -110,15 +110,11 @@ (funcall body-thunk ctx)))))) (define-instruction xsl:literal-attribute (args env) - (destructuring-bind ((name &optional uri) &body body) args + (destructuring-bind ((name &optional uri) value) args (declare (ignore uri)) ;fixme - (let ((value-thunk (compile-instruction `(progn ,@body) env))) - (lambda (ctx) - (cxml:attribute - name - (with-text-output-sink (s) - (cxml:with-xml-output s - (funcall value-thunk ctx)))))))) + #'(lambda (ctx) + (declare (ignore ctx)) + (cxml:attribute name value)))) (define-instruction xsl:text (args env) (destructuring-bind (str) args @@ -167,10 +163,10 @@ ;; fixme: parse decls here #'identity)) (lambda (ctx) - (let* ((node-set (funcall sorter (funcall select-thunk ctx))) - (n (length node-set))) + (let* ((nodes (xpath:all-nodes (funcall sorter (funcall select-thunk ctx)))) + (n (length nodes))) (loop - for node in node-set + for node in nodes for i from 1 do (funcall body-thunk -- 2.11.4.GIT