short-attribute.xtp
来自「解压在c盘」· XTP 代码 · 共 52 行
XTP
52 行
<s1 title="Attribute Value Templates"><p>Because calculating attributes is very common, the XSLT standardadds a special syntax for attribute value templates.A stylesheet can uses an attribute value template to calculatethe template value for the element directly. Curly brackets introducea value-of expression, e.g. "{@class}". The following stylesheetis a direct translation of the previous example.</p><example title='default.xsl'><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"><xsl:template match="box"> <table class="{@class}"> <tr> <td> <xsl:apply-templates/> </td> </tr> </table></xsl:template></xsl:stylesheet></example><p>The example XTP and its generated HTML is identical to the previous examplesince attribute value templates are just a syntactic shortcut.</p><example title='hello.xtp'><example><example>This is an example.</example></example><results><table class="example"><tr> <td>This is an example</td></tr></table></results></example><s2 title="Summary"><ul><li><var/"{...}"/> interpolates an attribute's value.</ul></s2></s1>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?