XSLT转换HTML的问题

来源:百度知道 编辑:UC知道 时间:2024/05/19 04:09:20
下面是有关学生的student.xml文档,请编写出相应的XSLT文档将其转换成的HTML格式,以表格的方式显示。
<?xml version="1.0" encoding="UTF-8"?>
<student>
<info name="Zhang San">
<number>A1001</number>
<address>HeBei</address>
<study_year>2</study_year>
</info>
<info name="Xiao Ming">
<number>A1002</number>
<address>HuBei</address>
<study_year>2</study_year>
</info>
<info name="Chen Kai">
<number>A1003</number>
<address>XingJiang</address>
<study_year>2</study_year>
</info>
</student>

<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html xmlns="http://www.w3.org/1999/xhtml">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"/>
<body>
<center>
<table border="1">
<tr>
<td>info:name</td>
<td>number</td>
<td>address</td>
<td>study_year</td>
</tr>
<xsl:for-each select="student/info">
<tr>
<td><xsl:value-of select="@name"/></td><