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

📄 5.txt

📁 JavaWeb服务应用开发详解的配套源码,欢迎下载
💻 TXT
字号:

例程5-1
<?xml-stylesheet type="text/xml" href="#style1"?>
<doc>
  <head>
    <xsl:stylesheet id="style1" version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:fo="http://www.w3.org/1999/XSL/Format">
      <xsl:import href="doc.xsl"/>
      <xsl:template match="id(''''foo'''')">
        <fo:block font-weight="bold">
          <xsl:apply-templates/>
        </fo:block>
      </xsl:template>
      
      <xsl:template match="xsl:stylesheet">
        <!-- ignore -->
      </xsl:template>
    </xsl:stylesheet>
  </head>
  <body>
    <para id="foo">
      ...
    </para>
  </body>
</doc>
例程5-2
<?xml version="1.0"?>
<investment>
  <type>stock</type>
  <name>Microsoft</name>
  <price type="high">100</price>
  <price type="low">94</price>
</investment>
例程5-3
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
  <xsl:output method="xml" indent="yes"/>
  <xsl:template match="investment">
    <xsl:element name="{type}">
      <xsl:attribute name="name" >
        <xsl:value-of select="name"/>
      </xsl:attribute>
      <xsl:for-each select="price">
        <xsl:attribute name="{@type}" >
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:for-each>
    </xsl:element>
  </xsl:template>
</xsl:stylesheet>

⌨️ 快捷键说明

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