|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hi,
I have a block of XML with image elements. I succeded transform it into HTML to see all the images, but only with one image in a row. I want to display the images, 3 in a row and only then move to a new tr element, so that each row contain 3 images (or less). Is there any idea of how to do that? Thanks in advanced, Ami. |
|
#2
|
|||
|
|||
|
You did not give any indication of your xml file layout.
However the follwoing XSLT snippet from an earlier answer I gave (April 04) should give you the basic idea of what to do: 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 > XSL transformation |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|