次の方法で共有


<xsl:if> の例 3

次の item テンプレート規則は、表の行を 1 行おきに黄色にします。

XML ファイル (items.xml)

XSLT ファイル (ifyellow.xsl)

出力

これは書式付き出力です。

書式付き出力

これはプロセッサ出力です。

<html>

<body>

<table border="1" cellpadding="2" cellspacing="0" width="50%">

<tr>Car</tr>

<tr bgcolor="yellow">Pen</tr>

<tr>LP Record</tr>

<tr bgcolor="yellow">Wisdom</tr>

<tr>Cell phone</tr>

...

</table>

</body>

</html>

参照

概念

<xsl:if> の例 1
<xsl:if> の例 2
<xsl:if> の例 4