Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
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 software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 29th, 2005, 04:28 AM
Registered User
Join Date: Oct 2004
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default adding an image {$photo_server}


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>

The image is retrieved via:

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

Any ideas?

Old July 29th, 2005, 11:13 AM
joefawcett's Avatar
Wrox Author
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts

<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>

Joe (Microsoft MVP - XML)

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 06:35 PM
dynamic adding image to crystal report ywchan Crystal Reports 3 February 16th, 2005 09:48 AM
Dynamically adding Image to web page koneruvijay VS.NET 2002/2003 4 March 14th, 2004 08:42 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.