Russ Tyndall | 6 May 2010 15:58
Favicon
Gravatar

Yaclml sxml comments

I have comments that need to get from tal through yaclml and out to
the output stream, but currently the xmls parser doesnt save the value
of the comment, and so all comments are dropped on parsing.  I can
do <tal:tal tal:content-as-is="&quot;&lt;!-- test --&gt;&quot;" />,
but that seems a touch silly and error prone. I have attached a patch
that will allow comments to appear as strings in the xmls
representation, which (for me) allows comments to go from tal
unmolested to the output stream (when *strip-comments* is nil).

This bug was also mentioned in the following blog post:
http://www.3ofcoins.net/2010/01/21/yaclml-in-pictures-part-ii-templating/

Hope this is useful for others,
Russ
diff --git a/src/tal/xmls.lisp b/src/tal/xmls.lisp
index 409d458..2135457 100644
--- a/src/tal/xmls.lisp
+++ b/src/tal/xmls.lisp
 <at>  <at>  -501,14 +501,18  <at>  <at>  goes (assuming *convert-entities* is non-NIL)."
                                                             nil)
                                                         (state-nsstack s))))))

-(defrule comment ()
+(defrule comment ()  
   (and
    (match-seq #\! #\- #\-)
-   (progn
-     (loop until (match-seq #\- #\- #\>)
(Continue reading)


Gmane