Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > XML > XSLT
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old July 29th, 2005, 04:28 AM
Registered User
 
Join Date: Oct 2004
Location: Bristol, , United Kingdom.
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default adding an image {$photo_server}

Hello...

I have a template which displays a list of names. I would like to add an image to each name...I can do it as two seperate templates but cannot work out how to combine the two.

<xsl:template name="displayPhotos">
    <xsl:param name="currentNodes"/>
    <xsl:for-each select="$currentNodes"> Name: <xsl:value-of select="name"/>
    <xsl:if test="position() mod 5 =0"><br/></xsl:if>
    </xsl:for-each>
    </xsl:template>

The image is retrieved via:

img src="{$photo_server}/?studentId=$photoId

Any ideas?

Reply With Quote
  #2 (permalink)  
Old July 29th, 2005, 11:13 AM
joefawcett's Avatar
Wrox Author
Points: 9,712, Level: 42
Points: 9,712, Level: 42 Points: 9,712, Level: 42 Points: 9,712, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,066
Thanks: 1
Thanked 36 Times in 35 Posts
Default

Code:
<xsl:template name="displayPhotos">
    <xsl:param name="currentNodes"/>
    <xsl:for-each select="$currentNodes"> Name: <xsl:value-of select="name"/><img src="{$photo_server}/?studentId={$photoId}"/>
    <xsl:if test="position() mod 5 =0"><br/></xsl:if>
    </xsl:for-each>
    </xsl:template>
--

Joe (Microsoft MVP - XML)
Reply With Quote
Reply


Thread Tools
Display Modes

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding Image on Canvas seikwon180 Pro Java 1 July 17th, 2013 02:09 AM
set image on <asp:Image> stored in DataBase myself.panku ASP.NET 2.0 Professional 1 August 11th, 2008 10:41 AM
xslt adding image palli2004 XSLT 2 December 30th, 2006 05:35 PM
dynamic adding image to crystal report ywchan Crystal Reports 3 February 16th, 2005 08:48 AM
Dynamically adding Image to web page koneruvijay VS.NET 2002/2003 4 March 14th, 2004 07:42 PM



All times are GMT -4. The time now is 08:20 AM.


Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.