📄 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 + -