Velocity Reviews - Computer Hardware Reviews

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

Reply
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
 
      08-22-2006
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:

<td>
<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"/>
</option>
<xsl:for-each>
</select>

</td>
</tr>

<tr>

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

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

</td>


Extraxt from my XML File

<Printers>

<Inkjet>
<model>Stylus C86</model>
<Colour>Separate Cartridges</Colour>
<ColourPrice>None</ColourPrice>
<colourYellow>C13T045440</colourYellow>
<colourYellowPrice>Lm 6.00</colourYellowPrice>
<colourCyan>C13T045240</colourCyan>
<colourCyanPrice>Lm 6.00</colourCyanPrice>
<colourmagenda>C13T045340</colourmagenda>
<colourMagendaPrice>Lm 6.00</colourMagendaPrice>
<Black>C13T04410</Black>
<blackPrice>Lm 9.50</blackPrice>
<image>C86.gif</image>
</Inkjet>

</Printers>

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

Thanks in anticipation,

Alan
 
Reply With Quote
 
 
 
Reply

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



Advertisments