2 つの異なる品質を持つアイテムのリストを含む XML ファイルがあり、2 つのカテゴリのアイテムを一覧表示する HTML 出力を作成し、両方に a で始まる番号付けシーケンスを作成する必要があります。解決策が見つかりません。これまでに作成したファイルは次のとおりです。
XML
<?xml version="1.0" encoding="UTF-8"?>
<refrigerator>
<item>
<quality>Good</quality>
<item_name>eggs</item_name>
</item>
<item>
<quality>Good</quality>
<item_name>chess</item_name>
</item>
<item>
<quality>Good</quality>
<item_name>soda</item_name>
</item>
<item>
<quality>Bad</quality>
<item_name>chicken meat</item_name>
</item>
<item>
<quality>Bad</quality>
<item_name>spinach</item_name>
</item>
<item>
<quality>Bad</quality>
<item_name>potatoes</item_name>
</item>
</refrigerator>
XSL
<table width="100%" border="1">
<tr>
<td>
<strong>These are the good items in the refrigerator/strong>
<xsl:for-each select="refrigerator/item">
<xsl:if test="quality = 'Good'">
<strong><xsl:number format="a) " value="position()"/></strong>
<xsl:value-of select="item_name"/>
</xsl:if>
</xsl:for-each>
, <strong>and these are the bad ones/strong>
<xsl:for-each select="refrigerator/item">
<xsl:if test="quality = 'Bad'">
<strong><xsl:number format="a) " value="position()"/></strong>
<xsl:value-of select="item_name"/>
</xsl:if>
</xsl:for-each>
. Some more text over here.</td>
</tr>
</table>
HTML
冷蔵庫の良いものは、a) 卵、b) チェス、c) 炭酸飲料、悪いものは、d) 鶏肉、e) ほうれん草、f) じゃがいもです。ここにいくつかのテキストがあります。
出力が必要
冷蔵庫の良いものは、a) 卵、b) チェス、c) ソーダ、悪いものは、a) 鶏肉、b) ほうれん草、c) じゃがいもです。ここにいくつかのテキストがあります。
どんな助けでも大歓迎です。
よろしく。
A.