Need help with displaying images from an xml file with XSLT

Joined
Aug 22, 2006
Messages
1
Reaction score
0
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,005
Messages
2,570,264
Members
46,859
Latest member
HeidiAtkin

Latest Threads

Top