gbook.xsl

来自「网页留言簿源代码」· XSL 代码 · 共 59 行

XSL
59
字号
<?xml version="1.0"?>

<!--

GuestBook XSL File

Chris Eastwood, 2000

http://www.vbcodelibrary.com
//-->

<!-- Standard XSL stylesheet processing Instructions //-->

<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">

<!-- Only interested in the root document object match //-->

<xsl:template match="/">

<HTML>

  <center>
    <h1>Welcome to the ASP/XML GuestBook</h1>
  </center>

  <table border = "1" width="100%">
    <tr>
      <td bgcolor="#FF0000"><font color="#FFFFFF">GuestBook Entries</font></td>
    </tr>
    <tr>
      <td>
         <table width="100%">
<!-- 
     Here's where we write out a row for each entry in the guestbook xml.
     - Note how I use the 'for-each' xsl statements to get the xml contents
       in descending date order
//-->
           <xsl:for-each select="guestbook/entry" order-by="-entry[@date]">
             <tr>
               <td width = "100%">
                 <b>Date: </b> <xsl:value-of select="@date"/><br/>
                 <b>Name:</b> <xsl:value-of select="name"/><br/>
                 <b>Email: </b> <xsl:value-of select="email"/><br/>
                 <b>HomePage : </b> <xsl:value-of select="homepage"/><br/>
                 <b>Country : </b> <xsl:value-of select="country"/><br/>
                 <b>Comment : </b> <pre><xsl:value-of select="comment"/></pre><br/>      
                 <hr/>
               </td>
             </tr>
        </xsl:for-each>
      </table>    
    </td>
  </tr>
</table>

</HTML>

</xsl:template>
</xsl:stylesheet>

⌨️ 快捷键说明

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