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 April 13th, 2004, 02:29 PM
digitalalias's Avatar
digitalalias digitalalias is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: Georgia, USA
Posts: 164 digitalalias User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 52 m 33 sec
Reputation Power: 5
Send a message via ICQ to digitalalias Send a message via AIM to digitalalias Send a message via MSN to digitalalias Send a message via Yahoo to digitalalias
Arrow XML-driven photo album

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.

Reply With Quote
  #2  
Old April 14th, 2004, 12:31 AM
fpmurphy fpmurphy is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Dec 2003
Location: USA
Posts: 289 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 3 h 22 m 4 sec
Reputation Power: 6
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>

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > XML-driven photo album


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 6 hosted by Hostway
Stay green...Green IT