elements.xsl

来自「java 编程源代码」· XSL 代码 · 共 34 行

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

<!-- Fig. D.6 : elements.xsl             -->
<!-- Using xsl:element and xsl:attribute -->

<xsl:stylesheet version = "1.0" 
   xmlns:xsl = "http://www.w3.org/1999/XSL/Transform">

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

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

   <xsl:template match = "game">
      <xsl:element name = "@title">

         <xsl:attribute name = "id">
            <xsl:value-of select = "id"/>
         </xsl:attribute>

         <comment>
            <xsl:value-of select = "para"/>
         </comment>

      </xsl:element> 
   </xsl:template>

</xsl:stylesheet>

⌨️ 快捷键说明

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