[bknr-cvs] r2485 - branches/trunk-reorg/bknr/web/src/web

hhubner at common-lisp.net hhubner at common-lisp.net
Wed Feb 13 10:15:14 UTC 2008


Author: hhubner
Date: Wed Feb 13 05:15:12 2008
New Revision: 2485

Modified:
   branches/trunk-reorg/bknr/web/src/web/template-handler.lisp
Log:
Fix templater so that top-level element can be user-defined again.


Modified: branches/trunk-reorg/bknr/web/src/web/template-handler.lisp
==============================================================================
--- branches/trunk-reorg/bknr/web/src/web/template-handler.lisp	(original)
+++ branches/trunk-reorg/bknr/web/src/web/template-handler.lisp	Wed Feb 13 05:15:12 2008
@@ -147,8 +147,9 @@
 	   (let ((*tag-children* children))
 	     (apply (find-tag-function expander name ns)
 		    (append (loop for (key name) in attrs
+                                  unless (consp key) ; ignore attributes with namespace
 				  collect (make-keyword-from-string key)
-				  collect (expand-variables name #'get-template-var))))))
+                                  and collect (expand-variables name #'get-template-var))))))
           (t
            (sax:start-element *html-sink* nil nil name
                               (xmls-attributes-to-sax (rcurry #'expand-variables #'get-template-var) attrs))
@@ -164,7 +165,7 @@
   (sax:start-element *html-sink* (node-ns toplevel) (node-name toplevel) (node-name toplevel)
 		     (cxml-xmls::compute-attributes/lnames toplevel t))
   (let ((*template-expander* expander))
-    (mapc (curry #'emit-template-node expander) (node-children toplevel)))
+    (emit-template-node expander toplevel))
   (sax:end-element *html-sink* (node-ns toplevel) (node-name toplevel) (node-name toplevel)))
 
 (defun find-template (dir components)



More information about the Bknr-cvs mailing list