以下のコードを使用して、XSLTを使用してXMLファイルをHTMLとして表示しました
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="Report/Scripts">
<html>
<head>
<title>Mobiuss.rtp Test Execution Results</title>
<link rel="stylesheet" href="xmlstyle.css" />
</head>
<body>
<xsl:for-each select="Script">
<h1><xsl:value-of select="@File"/></h1>
Execution log
<br>
</br>
<table class="sortable">
<tr>
<th>Time</th>
<th>Position</th>
<th>Type</th>
<th>Message</th>
</tr>
<xsl:for-each select="Message">
<tr>
<td> <xsl:value-of select="@Time"/></td>
<td>Line <xsl:value-of select="@Line"/></td>
<td> <xsl:value-of select="@Type"/></td>
<td> <xsl:value-of select="@Message"/></td>
</tr>
</xsl:for-each>
</table>
</xsl:for-each>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
上記のコードは、XMLファイルをhtmlとして表示し、約4つのテーブルを作成します(XMLによって異なります)が、何らかの理由で、最初のテーブルだけがCSSに従っているのか、他のすべてのテーブルのスタイルが設定されていないのかわかりません。
CSSコードはここにあります:
@CHARSET "ISO-8859-1";
.sortable {width:100%; height:40px; border:1px solid #ccc; background-color:#EEE0E5}
.sortable th {padding:4px 6px 6px; background:#444; color:#fff; text-align:center; color:#ccc}
.sortable td {padding:2px 4px 4px; background:#fff; border-bottom:1px solid #ccc; overflow:auto}
.sortable .head {background:#444 url(images/sort.gif) 6px center no-repeat; cursor:pointer; padding-left:18px}
.sortable .desc {background:#222 url(images/desc.gif) 6px center no-repeat; cursor:pointer; padding-left:18px}
.sortable .asc {background:#222 url(images/asc.gif) 6px center no-repeat; cursor:pointer; padding-left:18px}
.sortable .head:hover, .sortable .desc:hover, .sortable .asc:hover {color:#fff}
.sortable .even td {background:#f2f2f2}
.sortable .odd td {background:#fff}
作成されるすべてのテーブルが適切なスタイルになるように、コードで何を変更するかを教えてください。