|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
Hi All,
I'm pretty new to XML. I want to make a type of photo album for a client's web site driven by XML. I simply have 6 records(images) to display and as you can all guess it's duplicating the images. Code:
<xml id="dsoInventory" src="trailers.xml"></xml> <table width="100%" border="0" id="InventoryTable" datasrc="#dsoInventory"> <tr align="center"> <td><img datafld="img" width="150" height="113"><br><span datafld="name"></span></td> <td><img datafld="img" width="150" height="113"><br><span datafld="name"></span></td> <td><img datafld="img" width="150" height="113"><br><span datafld="name"></span></td> </tr> </table> What I want it to do is display 2 rows with 3 columns.
__________________
Marc F. "Let the blind lead the blind... it's more fun to watch." Last edited by digitalalias : April 13th, 2004 at 02:35 PM. |
|
#2
|
|||
|
|||
|
Something like the following should work. Replace 'file/image'
with appropriate element name(s). Code:
<table>
<xsl:for-each select="file/image">
<xsl:if test="(position() mod 3) = 1">
<tr>
<td><xsl:value-of select="."/></td>
<td><xsl:value-of select="following-sibling::product[position()=1]"/></td>
<td><xsl:value-of select="following-sibling::product[position()=2]"/></td>
</tr>
</xsl:if>
</xsl:for-each>
</table>
|
![]() |
| Viewing: Dev Shed Forums > Programming Languages - More > XML Programming > XML-driven photo album |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|