在XSLT上很綠,我正在使用的系統之一是使用它在前端生成一些表。基本上執行鍼對DB2實例的查詢結果集被解析成XML和輸出類似於...XSLT在不使用for-each的情況下推進節點
<ResultSet>
<Row>
<node1></node1>
<node2></node2>
<etc>
</Row>
<Row>
</Row>
</ResultSet>
我不知道如何來推進的節點,而不需要使用的for-each循環。這是從我對XSLT內部變量的理解(這是有限的)。
在頁面末尾,我必須使用上面創建的變量創建一個表格。假設結果集是它將返回三行而不多/少。從我的xslt的一些代碼如下...
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html"/>
<xsl:template match="/">
....after some html population...
<tbody>
<tr>
<td>Column</td>
<td class="rightAligned">
<xsl:call-template name="formatAsCurrencyNoDecimals">
<xsl:with-param name="numberToFormat"
select="summarizedLoads/summary/total" />
</xsl:call-template>
</td>
.....xsl continues for this row....
一旦完成這一步需要做什麼來推進到下一行?我的是,我將不得不修改根模板匹配到<xsl:template match="/summarizedLoads/">
,然後在每行後調用。
在每行的內部,我需要創建幾個變量供最終使用。
所有行也包含相同數量的數據。希望這是明確的,我想要做什麼,如果需要從我這裏任何其他事情,請讓我知道。
很好的回答。 +1 – hoodaticus