Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Xml 使用XSL样式表选择 一点 在校园 国内的 麻省理工学院 距离 国际的 BMM 在校园 国内的 麻省理工学院 在校园 国内的 一点 在校园 国内的_Xml_Xslt - Fatal编程技术网

Xml 使用XSL样式表选择 一点 在校园 国内的 麻省理工学院 距离 国际的 BMM 在校园 国内的 麻省理工学院 在校园 国内的 一点 在校园 国内的

Xml 使用XSL样式表选择 一点 在校园 国内的 麻省理工学院 距离 国际的 BMM 在校园 国内的 麻省理工学院 在校园 国内的 一点 在校园 国内的,xml,xslt,Xml,Xslt,我试图选择最下面的学生编号,并将其显示为一个没有标题的表格,只包含学生编号、课程、学习模式和学生类型 <?xml version = "1.0" encoding = "UTF-8"?> <?xml-stylesheet type="text/xsl" href="student-stylesheet.xsl"?> <students> <student student-number = "1625344"> <pro

我试图选择最下面的学生编号,并将其显示为一个没有标题的表格,只包含学生编号、课程、学习模式和学生类型

<?xml version = "1.0" encoding = "UTF-8"?>
<?xml-stylesheet type="text/xsl" href="student-stylesheet.xsl"?>
<students>
    <student student-number = "1625344">
        <program> BIT </program>
        <study-model> on-campus </study-model>
        <student-type> domestic </student-type>
    </student>
    <student student-number = "2341235">
        <program> MIT </program>
        <study-model> distance </study-model>
        <student-type> international </student-type>
    </student>
    <student student-number = "1234567">
        <program> BMM </program>
        <study-model> on-campus </study-model>
        <student-type> domestic </student-type>
    </student>
    <student student-number = "8899009">
        <program> MIT </program>
        <study-model> on-campus </study-model>
        <student-type> domestic </student-type>
    </student>
    <student student-number = "0987654">
        <program> BIT </program>
        <study-model> on-campus </study-model>
        <student-type> domestic </student-type>
    </student>
</students>

节目
学生模型
学生类型

这是我当前的sylesheet,它选择的是第一个学生,而不是最后一个,并且还缺少学生号

要获得学生号,您应该将新的TD设置为
。如果只想获取最后一个学生的信息,应该使用类似于

XLS is not XSL的谓词。不要混淆。当我输入上面的内容时,它呈现为一个空白的白色屏幕,所以不选择任何内容
    <?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited by XMLSpy® -->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
  <html>
  <body>
    <table border="1">
      <tr bgcolor="#9acd32">
        <th>Program</th>
        <th>Student Model</th>
        <th>Student Type</th>
      </tr>
      <tr>
        <td><xsl:value-of select="students/student/program"/></td>
        <td><xsl:value-of select="students/student/study-model"/></td>
        <td><xsl:value-of select="students/student/student-type"/></td>
      </tr>
    </table>
  </body>
  </html>
</xsl:template>
</xsl:stylesheet>