⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 xtp-page.xtp

📁 解压在c盘
💻 XTP
字号:
<s1 title="Link Rewriting"><p>Rewriting links to encode sessions is a tedious and error-prone task.If you use URL-encoded sessions, every &lt;a> link and every &lt;form> actionneeds a rewritten link using <var/response.encodeURL()/>.  XTP can rewritethose for you automatically.</p><example title="stylesheet.xsl">&lt;xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"                version="1.0">  &lt;!-- make sure '&lt;' is not printed as '&amp;lt;' -->  &lt;xsl:output disable-output-escaping='true'/>  &lt;!-- copy input to output -->  &lt;xsl:template match='*|@*'>    &lt;xsl:copy>      &lt;xsl:apply-templates select='node()|@*'/>    &lt;/xsl:copy>  &lt;/xsl:template>  &lt;!-- rewrite &lt;a href> -->  &lt;xsl:template match="a[@href]">    &lt;a href='&lt;%= response.encodeURL("{@href}") %>'>      &lt;xsl:apply-templates select="node()|@*[name(.)!="href"]"/>    &lt;/a>  &lt;/xsl:template>&lt;/xsl:stylesheet></example><p>Your XTP page may look something like:</p><example title='test.xtp'>&lt;?xml-stylesheet href='stylesheet.xsl'?>&lt;h1>My test&lt;/h1>Adding: 2 + 2 = &lt;%= 2 + 2 %>&lt;p>New? &lt;%= session.isNew() %>&lt;p>And &lt;a href='test.xtp'>linking&lt;/a></example><p>The transformed file will look like:</p><results>&lt;?xml-stylesheet href='stylesheet.xsl'?>&lt;h1>My test&lt;/h1>Adding: 2 + 2 = &lt;%= 2 + 2 %>&lt;p>New? &lt;%= session.isNew() %>&lt;p>And &lt;a href='&lt;%= response.encodeURL("test.xtp") %>'>linking&lt;/a></results></s1>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -