例7-5.xsl

来自「深入浅出XML示例下载」· XSL 代码 · 共 49 行

XSL
49 行
字号
<?xml version="1.0" encoding="GB2312"  ?> 
<xsl:stylesheet xmlns:xsl="http://www.w3.org/TR/WD-xsl">

<xsl:template match="/">
 <html>
  <xsl:apply-templates/>
 </html>
</xsl:template>

<xsl:template match="BookLib">
 <body>
 <xsl:apply-templates/>
 </body>
</xsl:template>

<xsl:template match="Book">
 <xsl:apply-templates select="Title | Author"/>
</xsl:template>

<xsl:template match="Title">
  <Font size="3" color="#0000FF">
  <BR></BR><xsl:value-of select="."/>
  </Font>
</xsl:template>

<xsl:template match="Author">
  <Font size="3" color="#FF0000">
   <xsl:value-of select="."/>
  </Font>
</xsl:template>

<xsl:template match="PressDate">
  <Font size="3" color="#FF00FF">
   <xsl:value-of select="."/>
  </Font>
</xsl:template>

<xsl:template match="Price">
  <Font size="3" color="#999999">
   <xsl:value-of select="."/>
  </Font>
</xsl:template>

</xsl:stylesheet>




⌨️ 快捷键说明

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