XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old September 15th, 2004, 09:32 PM
amiturgman amiturgman is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 1 amiturgman User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Unhappy XSL transformation

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.

Reply With Quote
  #2  
Old September 18th, 2004, 06:27 PM
fpmurphy fpmurphy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: USA
Posts: 305 fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level)fpmurphy User rank is Corporal (100 - 500 Reputation Level) 
Time spent in forums: 1 Day 7 h 17 m 54 sec
Reputation Power: 7
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>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XSL transformation


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT