Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > XML > Need help with displaying images from an xml file with XSLT

Thread Tools

Need help with displaying images from an xml file with XSLT

megabyte megabyte is offline
Junior Member
Join Date: Aug 2006
Posts: 1
Hi everyone,

I am trying to implement a dropdown menu that gets populated by data from the xml file. The user could then make a choice from this menu, and according to the choice made, a different image is to be displayed. The "SRC" is also to be obtained from the xxml file.

What I have done uptil now is to populate the menu from the xml file, but have difficulty in displaying the image according to the user's choice.

Below is what I have done uptil now:

<select name="Menu" onChange="printer.src='{image}';">
<option>Inkjet Models</option>

<xsl:for-each select="Printers/Inkjet">
<option value="{image}">
<xsl:value-of select="model"/>



<td border="1" valign="middle">

<img name="printer" src="blank.gif"/>


Extraxt from my XML File


<model>Stylus C86</model>
<Colour>Separate Cartridges</Colour>
<colourYellowPrice>Lm 6.00</colourYellowPrice>
<colourCyanPrice>Lm 6.00</colourCyanPrice>
<colourMagendaPrice>Lm 6.00</colourMagendaPrice>
<blackPrice>Lm 9.50</blackPrice>


I really appreciate any help. Kindly let me know if i was not clear in my explanation.

Thanks in anticipation,

Reply With Quote

Thread Tools

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 On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
need help with XSLT displaying multiple (duplicate) nodes Mad Scientist Jr XML 1 07-19-2007 11:53 PM
Problem to insert an XML-element by XSLT-converting from one XML-file into another XML-file jkflens XML 2 05-30-2006 09:41 AM
Displaying Images in XML file. AnandSancheti XML 10 11-14-2005 10:27 PM
Need help displaying images dynamically in a table =?Utf-8?B?dHBlcnJp?= ASP .Net 2 06-27-2005 12:50 AM
Need help with displaying dynamic images in browser using ASP.NET. Ken Varn ASP .Net 2 05-11-2004 05:44 PM