anchor.diff:  (defun get-cached-template (pathname expander)
     (let* ((table (template-expander-cached-templates expander))
            (namestring (namestring pathname))
  -         (cache-entry (gethash namestring table))
  +         (parsed-template (gethash namestring table))
            (current-write-date (file-write-date namestring)))
  -    (unless (and cache-entry (eql (car cache-entry) current-write-date))
  -      (setf cache-entry
  -            (cons current-write-date (parse-template pathname)))
  -      (setf (gethash namestring table) cache-entry))
  -    (cdr cache-entry)))
  -
  -(defun emit-template (expander stream node env)
  +    (unless (and parsed-template
  +                 (eql current-write-date (parsed-template-last-change parsed-template)))
  +      (setf parsed-template (parse-template pathname)
  +            (gethash namestring table) parsed-template))
  +    parsed-template))
  +
  +(defun emit-template (expander stream parsed-template env)
     (let* ((*template-env* env)
            (*html-sink* (cxml:make-character-stream-sink stream :canonical nil)))
  -    (if (node-attribute node "suppress-xml-headers")
  -	(emit-parsed-template expander node)
  -	(progn
  -	  (sax:start-document *html-sink*)
  -	  (sax:start-dtd *html-sink*
  -			 "html"
  -			 "-//W3C//DTD XHTML 1.0 Transitional//EN"
  -			 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd")
  -	  (sax:end-dtd *html-sink*)
  -	  (emit-parsed-template expander node)))
  +    (sax:start-dtd *html-sink*
  +                   "html"
  +                   "-//W3C//DTD XHTML 1.0 Transitional//EN"
  +                   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd")
  +    (sax:end-dtd *html-sink*)
  +    (let ((*namespace-attributes* (parsed-template-namespace-attrs parsed-template))
  +          (*nsuri-alias-map* (parsed-template-nsuri-alias-map parsed-template)))
  +      (emit-parsed-template expander parsed-template))
  +    ;; We call sax:end-document to close the sink, which works even though we did not call sax:start-document.
       (sax:end-document *html-sink*)))
  +
   ;; template handler
   
   (defclass template-handler (prefix-handler template-expander)
  
positive.code: 				      :specified-p t))))
  	  attrs))
  
  (defun parse-template (template-pathname)
    (let ((sax:*include-xmlns-attributes* t))
      (cxml:parse-file (namestring (probe-file template-pathname))
  		     (cxml-xmls:make-xmls-builder)
                       :validate nil)))
  
  (defvar *tag-children*)
  
  (defun emit-tag-children ()
    "Function to be called by application defined tags to emit their children."
    (mapc (curry #'emit-template-node *template-expander*) *tag-children*))
  
  (defun emit-template-node (expander node)
    (if (stringp node)
  
negative.code:                                   and collect (expand-variables name #'get-template-var))))))
            (t
             (sax:start-element *html-sink* nil nil name
                                (append (when *namespace-attributes*
                                          (prog1
                                              *namespace-attributes*
                                            (setf *namespace-attributes* nil)))
                                        (xmls-attributes-to-sax (rcurry #'expand-variables #'get-template-var) attrs)))
             (dolist (child children)
               (emit-template-node expander child))
             (sax:end-element *html-sink* nil nil name))))))
  
  (defun emit-parsed-template (expander parsed-template)
    "Emit the given parsed template as XHML to *HTML-SINK*."
    (let* ((*template-expander* expander))
      (emit-template-node expander (parsed-template-dom parsed-template))))
  
  (defun find-template (dir components)
    (if (null components)
  