answer2xsl.xsl

来自「所在类别: 随书资源/T 工业技术/TP 自动化技术、计算机技术/TP31 计算」· XSL 代码 · 共 35 行

XSL
35
字号
<?xml version='1.0' encoding="gb2312" ?>
<xsl:stylesheet
    xmlns:xsl="http://www.w3.org/TR/WD-xsl"
    xmlns="http://www.w3.org/TR/REC-html40" >
    <xsl:template match="/">
	<html><head><title>学生信息查询</title></head> 
	<body>
	   <xsl:apply-templates/>
	</body>
        </html>
    </xsl:template>
    <xsl:template match="查询结果">
        <center>
        <h2>学生信息查询结果</h2>
	<table border="1">	
           	<thead><th>学号</th><th>姓名</th><th>班级</th><th>系部</th></thead>
		<xsl:apply-templates/>	
	</table>
	</center>
    </xsl:template>
    <xsl:template match="学生信息">
        <tr>
           <td><xsl:value-of select="学号"/></td>
           <td><xsl:value-of select="姓名"/></td>
	   <xsl:apply-templates/>
	</tr>
     </xsl:template>
    <xsl:template match="班级信息">	
	<td><xsl:value-of select="班级"/></td>
	<xsl:apply-templates/>
     </xsl:template>
    <xsl:template match="系部信息">
        <td><xsl:value-of select="系部"/></td>
    </xsl:template>
</xsl:stylesheet>

⌨️ 快捷键说明

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