課題で以下の資料をテーブルで表示するというのですが、何が入力が間違っているみたいで、ご教授お願いいたします。
XSLです
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="Shift_JIS" />
<xsl:template match="students">
</xsl:template>
<xsl:template match="students">
<html>
<body>
<table border="3">
<tr>
<th>rank</th>
<th>id</th>
<th>name</th>
<th>point</th>
<th>grade</th>
</tr>
<xsl:apply-templates select="student">
<xsl:sort select="point" data-type="number" order="descending" />
</xsl:apply-templates>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="student">
<xsl:if test="point >= 60">
<tr> <xsl:apply-templates select="@id" /> <xsl:apply-templates select="name" /> <xsl:apply-templates select="point" /> </tr> </xsl:if> </xsl:template> <xsl:template match="@id"> <td> <id> <xsl:value-of select="." /> </id> </td> </xsl:template> <xsl:template match="name"> <td> <xsl:copy-of select="." /> </td> </xsl:template> <xsl:template match="point"> <td> <xsl:copy-of select="." /> </td> </xsl:template>
</xsl:stylesheet>
XMLです
?xml version="1.0" encoding="Shift_JIS" ?>
<students>
<student id="E99X0001">
<name>一橋太郎</name>
<point>85</point>
</student>
<student id="E99X0002">
<name>二宮恵</name>
<point>75</point>
</student>
<student id="E99X0003">
<name>三島和義</name>
<point>40</point>
</student>
<student id="E99X0004">
<name>四谷明美</name>
<point>87</point>
</student>
<student id="E99X0005">
<name>五木弘樹</name>
<point>60</point>
</student>
<student id="E99X0006">
<name>六本木朱里</name>
<point>82</point>
</student>
<student id="E99X0007">
<name>七星賢治</name>
<point>77</point>
</student>
<student id="E99X0008">
<name>八坂ほのか</name>
<point>62</point>
</student>
<student id="E99X0009">
<name>九鬼雅臣</name>
<point>45</point>
</student>
<student id="E99X0010">
<name>十川登喜子</name>
<point>100</point>
</student>
</students>大体この写真のテーブルのようにしたいです
https://teratail.com/uploads/contributed_images/37e24ae4d977129100ace281c9e15010.jpeg
回答2件
あなたの回答
tips
プレビュー