?? xslt-lite-eg.xtp
字號:
<title css='default.css' keywords="xsl,xslt,xml,jsp,resin,caucho,template,tag,library">XSLT-lite examples</title><summarylist/><section name=counter title="Counter"><p>XTP pages can use the counter just by adding the tag:</p><example title='counter.xtp'><eg-em>A counter example: </eg-em><ct:counter id='test'/></example><p>Here the patterns to do it. For efficiency, we've added the <code/cache/> directive. The cache directive tells XTP to execute thestylesheet only once and cache the generated JSP file.<example title='default.xsl'><#@ cache #>counter[@id] <<<eg-em><%=application.attribute["</eg-em><{@id}><eg-em>"]</eg-em><eg-em>%></eg-em>>>counter <<<eg-em><%= application.attribute.counter++ %></eg-em>>></example></section><section name=flow title="JSP flow control"><ul><li>ct:get prints the value of a variable<li>ct:if generates an if statement<li>ct:iter loops</ul><example title='definition of ct:get'>ct:get <<<eg-em><%=</eg-em> <{@expr}><eg-em> %></eg-em>>></example><example title='definition of ct:if'>ct:if <<<eg-em><% if (</eg-em><{@expr}><eg-em>) { %></eg-em> <xsl:apply-templates/><eg-em><% } %></eg-em>>></example><example title='definition of ct:iter'>ct:iter[@index] <<<eg-em><% for (var </eg-em><{@index}> <eg-em>in</eg-em> <{@expr}><eg-em>) { %></eg-em> <xsl:apply-templates/><eg-em><% } %></eg-em>>>ct:iter <<<eg-em><% for (var i in </eg-em><{@expr}><eg-em>) { %></eg-em> <xsl:apply-templates/><eg-em><% } %></eg-em>>></example></section>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -