Subject:Repeat images using FOR EACH loop Author:Sonika Colaso Date:27 Jul 2009 04:56 PM
Hello,
I'm new to XML & XSL and cannot figure out how to get this to work. Any help will be much appreciated!
I'm trying to loop through images and display it in each cell. For some reason, whatever i do, it just takes the first image and repeats that. I've tried many things, but cannot get it to read any other image. Here is a snippet of my XML code:
Now here is the XSL I am using to try to get it to loop the images into the table cells. It only picks the 3086.jpg image and repeats that into the cells. Please tell me what I am doing incorrectly, I've been struggling with this for a while now...thanks!!
Subject:Repeat images using FOR EACH loop Author:Sonika Colaso Date:28 Jul 2009 10:11 AM
Hi all, I'm still waiting for someone to respond to my query. Please let me know if I need to provide more information. Thanks in advance for the help!
Subject:Repeat images using FOR EACH loop Author:Sonika Colaso Date:29 Jul 2009 09:20 AM Originally Posted: 29 Jul 2009 09:21 AM
Awesome! Thanks Tony! That worked!! :) But I have another question now...kinda related...now I have 2 images showing up, atleast not repeating. But because I have specified 2 columns, it only wraps up into 2 cells and drops the third image. See code below. Any idea what I need to do to tell it to put the third image on the next row cell and so on? Basically 2 images per row but wrap to the next row if there are more than 2? Thanks again for the help!!
Subject:Repeat images using FOR EACH loop Author:Tony Lavinio Date:31 Jul 2009 09:16 AM
The usual method for handling things like this is to use the
'mod' function. If position() mod 2 = 0, then you're on an
even row - which in your case would be column 2. Otherwise,
you're on an odd row.
Subject:Repeat images using FOR EACH loop Author:Sonika Colaso Date:03 Aug 2009 09:43 AM
Thanks Toni. Could you please elaborate on this a bit? Is it something I can just include inside the code I posted? I think if I can get this figured out, should make a decent headway. So do let me know how I can incorporate that function into my code. Appreciate the help!
Subject:Repeat images using FOR EACH loop Author:Tony Lavinio Date:10 Aug 2009 10:59 AM
Can you supply a sample input file a and small (mostly) working example?
Then it would be easier to see exactly what you are doing so we can make
a better suggestion.