﻿<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>IT博客-asfman-文章分类-freemarker</title><link>http://www.cnitblog.com/asfman/category/7681.html</link><description>有些事，我们明知道是错的，也要去坚持，因为不甘心；有些人，我们明知道是爱的，也要去放弃，因为没结局；有时候，我们明知道没路了，却还在前行，因为习惯了。</description><language>zh-cn</language><lastBuildDate>Mon, 26 Sep 2011 13:39:55 GMT</lastBuildDate><pubDate>Mon, 26 Sep 2011 13:39:55 GMT</pubDate><ttl>60</ttl><item><title>macro</title><link>http://www.cnitblog.com/asfman/articles/49942.html</link><dc:creator>汪杰</dc:creator><author>汪杰</author><pubDate>Tue, 07 Oct 2008 07:35:00 GMT</pubDate><guid>http://www.cnitblog.com/asfman/articles/49942.html</guid><wfw:comment>http://www.cnitblog.com/asfman/comments/49942.html</wfw:comment><comments>http://www.cnitblog.com/asfman/articles/49942.html#Feedback</comments><slash:comments>3</slash:comments><wfw:commentRss>http://www.cnitblog.com/asfman/comments/commentRss/49942.html</wfw:commentRss><trackback:ping>http://www.cnitblog.com/asfman/services/trackbacks/49942.html</trackback:ping><description><![CDATA[&lt;#-- call the macro; the macro variable is already created: --&gt;<br>&lt;@test2 /&gt;<br>...<br>&lt;#-- create the macro variable: --&gt;<br>&lt;#macro test2&gt;<br>&nbsp; Test text<br>&lt;/#macro&gt;<br>&lt;#-- call the macro: --&gt;<br>&lt;@test foo="a" bar="b" baaz=5*8-2 /&gt; <br>&lt;#macro test foo bar baaz&gt;<br>&nbsp; Test text, and the params: ${foo}, ${bar}, ${baaz}<br>&lt;/#macro&gt;<br>&nbsp;&lt;#macro img src extra...&gt;<br>&nbsp; &lt;img src="${src?html}"<br>&nbsp; &lt;#list extra?keys as attr&gt;<br>&nbsp;&nbsp;&nbsp; ${attr}="${extra[attr]?html}"<br>&nbsp; &lt;/#list&gt;<br>&nbsp; &gt;<br>&lt;/#macro&gt;<br>&lt;@img src="http://www.21cp.net/images/logo_nav.gif" width=100 height=50 alt="Test"/&gt;<br><img src ="http://www.cnitblog.com/asfman/aggbug/49942.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.cnitblog.com/asfman/" target="_blank">汪杰</a> 2008-10-07 15:35 <a href="http://www.cnitblog.com/asfman/articles/49942.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item></channel></rss>