我的问题是:我必须使用 xslt 来处理我网站中的产品。以下是它的外观:
现在看起来像这样:
<tr>
所以,我的问题是如何在标签之间做这些分界线?
这是我的代码:
<table id="producers_table" >
<xsl:for-each select="document('udata://catalog/getCategoryList/void/producers//1/')/udata/items/item[not(@country=preceding-sibling::item/@country)]" >
<xsl:variable name="country_name" select="@country" />
<xsl:variable name="country_count" select="count($country_name)"/>
<tr id="test">
<td id="country_td">
<xsl:value-of select="document(concat('uobject://', $country_name))/udata/object/@name"/>
</td>
<xsl:for-each select="../item[@country = $country_name]">
<xsl:variable name="prod_count" select="document(concat('udata://catalog/getCountObjects/', @id))/udata"/>
<td umi:element-id="{@id}">
<a href="{@link}" umi:field-name="name" umi:delete="delete" umi:empty="&empty-section-name;">
<table class="object_table">
<tr>
<td align="center">
<img src="{document(concat('upage://', @id, '.header_pic'))//value}"/>
</td>
</tr>
<tr>
<td align="center" id="search_by_appointment_name">
<p>
<span><xsl:variable name="curr_producer_name" select="."/>
<xsl:value-of select="$curr_producer_name" />
</span>
 <sup class="object_count"><xsl:value-of select="$prod_count"/></sup>
</p>
</td>
</tr>
</table>
</a>
</td>
</xsl:for-each>
</tr>
</xsl:for-each>
</table>
我应该在哪里添加<hr/>
?
PS这是我尝试的一些结果:
1.
代码:
<table id="producers_table" >
<xsl:for-each select="document('udata://catalog/getCategoryList/void/producers//1/')/udata/items/item[not(@country=preceding-sibling::item/@country)]" >
<xsl:variable name="country_name" select="@country" />
<xsl:variable name="country_count" select="count($country_name)"/>
<tr id="test">
**<hr/>**
2.
 <sup class="object_count"><xsl:value-of select="$prod_count"/></sup>
</p>
</td>
</tr>
</table>
</a>
</td>
</xsl:for-each>
**<hr/>**
</tr>
</xsl:for-each>
</table>