This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Selecting First Node
- To: <XSL-List at lists dot mulberrytech dot com>
- Subject: [xsl] Selecting First Node
- From: "Koray Berk" <berkk at ims dot com dot tr>
- Date: Tue, 20 Mar 2001 10:00:28 +0200
- Reply-To: xsl-list at lists dot mulberrytech dot com
<Row>
<Columns>
<C Title="one" Value="VAL_1"/>
<C Title="two" Value="VAL_2"/>
<C Title="three" Value="VAL_3"/>
</Columns>
</Row>
<Row>
<Columns>
<C Title="one" Value="VAL_4"/>
<C Title="two" Value="VAL_5"/>
<C Title="three" Value="VAL_6"/>
</Columns>
</Row>
I want to obtain column titles then write the column values.
<table border="4" cellpadding="4">
<tr>
<xsl:for-each select="Row/Columns/C"> <!--Column Titles-->
<td><xsl:value-of select="@Title"/></td>
</xsl:for-each>
</tr>
<tr>
<xsl:for-each select="Row/Columns/C"><!--Column Values-->
<td><xsl:value-of select="@Value"/></td>
</xsl:for-each>
</tr>
</table>
But of course, this repeats the column titles. How can I make the first
for-each run only once for one Row?
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list