site_list.xsl
リスト表示用xsl。
<?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output method="html" encoding="UTF-8"/> <!-- ルートテンプレート --> <xsl:template match="/"> <table border="0"> <tr> <th>サイト名</th> <th>リンク</th> <th>ローカル</th> <th colspan="3">処理</th> <th>実行時間</th> <th>更新</th> </tr> <xsl:apply-templates select="sites/site"/> </table> </xsl:template> <!-- テーブル用テンプレート --> <xsl:template match="site"> <tr> <td> <span title="{@comment}"> <xsl:choose> <xsl:when test="string-length(@title) = 0"> <xsl:value-of select="@url"/> </xsl:when> <xsl:otherwise> <xsl:value-of select="@title"/> </xsl:otherwise> </xsl:choose> </span> </td> <td align="center"><a href="{@url}">●</a></td> <td align="center"><a href="{@path}">●</a></td> <td><button onclick="compress('{@url}');">圧縮</button></td> <td><button onclick="rmdir('{@url}');">削除</button></td> <td><button onclick="$('url').value='{@url}';$('title').value='{@title}';$('comment').value='{@comment}';">設定</button></td> <td><xsl:value-of select="@update"/></td> <td align="center"> <xsl:choose> <xsl:when test="@updated = 'true'"> <a href="javascript:wget('{@url}','{@title}','{@comment}');">●</a> </xsl:when> <xsl:when test="@updated = 'false'"> <xsl:text>×</xsl:text> </xsl:when> <xsl:otherwise> <xsl:text> </xsl:text> </xsl:otherwise> </xsl:choose> </td> </tr> </xsl:template> </xsl:stylesheet>