📄 xtp-jsp-stylescript.xtp
字号:
<s1 title="StyleScript examples"><summarylist/><s2 name=counter title="Counter"><p>XTP pages can use the counter just by adding the tag:</p><example title='counter.xtp'><var>A counter example: </var><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] <<<var><%=application.attribute["</var><{@id}><var>"]</var><var>%></var>>>counter <<<var><%= application.attribute.counter++ %></var>>></example></s2><s2 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 <<<var><%=</var> <{@expr}><var> %></var>>></example><example title='definition of ct:if'>ct:if <<<var><% if (</var><{@expr}><var>) { %></var> <xsl:apply-templates/><var><% } %></var>>></example><example title='definition of ct:iter'>ct:iter[@index] <<<var><% for (var </var><{@index}> <var>in</var> <{@expr}><var>) { %></var> <xsl:apply-templates/><var><% } %></var>>>ct:iter <<<var><% for (var i in </var><{@expr}><var>) { %></var> <xsl:apply-templates/><var><% } %></var>>></example></s2></s1>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -