📄 xtp-format.xtp
字号:
<s1 title="Format Sections"><p>A major advantage of XTP is its separation of content from formatting.Your source documents can use meaningful markup tags letting the stylesheetformat the output.</p><p>The XTP source of this tutorial uses a few tags for basic formatting:<var/<s1>/>, <var/<example>/>, and <var/<var>/>.</p><p>For example, the source for the tutorial index contains a sectionlike:</p><example title="index.xtp"><s1 title="XTP"><ul><li><a href="xtp-copy.xtp">XTP copy</a> treats XTP pages exactly like JSP.<li><a href="xtp-format.xtp">Format</a> sections, splitting style from content<li><a href="xtp-page.xtp">Encode links</a> for sessions automatically<li><a href="xtp-strict.xtp">Strict XSL</a> equivalent to StyleScript</ul></s1></example><p>The stylesheet contains a new rule for <var/s1/>. In thisexample, the rule only works when there is a <var/title/> attribute. In thereplacement code, <var/<xsl:value-of select="@title"/>/> inserts thevalue of the <var/title/> attribute.</p><example title="default.xsl"><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0"> <!-- make sure '<' is not printed as '&lt;' --> <xsl:output disable-output-escaping='true'/> <!-- copy input to output --> <xsl:template match='*|@*'> <xsl:copy> <xsl:apply-templates select='node()|@*'/> </xsl:copy> </xsl:template> <!-- s1 format --> <xsl:template match="s1[@title]"> <table width="100%" cellpadding="5" border="0"> <tr bgcolor="#ccddff"><td> <font size="+2"><b><value-of select="@title"/></b></font> </td></tr> </table> <xsl:apply-templates/> </xsl:template></xsl:stylesheet></example></s1>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -