File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes showing dynamic images with xml/xsl Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "showing dynamic images with xml/xsl" Watch "showing dynamic images with xml/xsl" New topic
Author

showing dynamic images with xml/xsl

Icebeer icebeer
Greenhorn

Joined: Jul 27, 2001
Posts: 1
ok, i've got some xml file like this:
<list>
<image>image1.gif</image>
.
.
.
</list>
i know, i have to use Javascript to display this images in a XSL file like
function ShowImage(pic, name) {
document.write ('<img src="images/' + pic + '" name="' + name + '" border="0">');
}
but this gets very annoying when it comes to "onMouseOver change the pic" pics and similar things (e.g. links, ...)
is there an easier way to solve this or do i have to stick to the JS way?
thanks for any advice,
Thomas
Mapraputa Is
Leverager of our synergies
Sheriff

Joined: Aug 26, 2000
Posts: 10065
Three is absolutely no need for JavaScript. You can output img tag with XSLT:
in your stylesheet:
<img src="{concat ('images/', list/image)}" onMouseOver="changeThePic()"/>
output:
<img onMouseOver="changeThePic()" src="images/image1.gif">
Put an XPath expression to access proper image instead of list/image. For example, if you have
<list>
<image>image1.gif</image>
<image>image2.gif</image>
</list>
and you want to access the second image, it will be "list/image[2]"
Also, you name doesn't comply with JavaRanch Official policy on registered names . Please, re-register following "FirstName LastName" pattern!

Uncontrolled vocabularies
"I try my best to make *all* my posts nice, even when I feel upset" -- Philippe Maquet
Thomas K
Greenhorn

Joined: Jul 30, 2001
Posts: 1
THX! i'm quite new to this so sorry for the feeble question
changed my name BTW, was in a hurry the last time.
nice board, skilled answers, i'm impressed.
cya
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
Your name "Thomas K" still does not comply with the JavaRanch naming policy. Note that your last name should be atleast two characters long.
Please spare a moment and re-register with a name that meets the requirements.
Thank you!


Open Group Certified Distinguished IT Architect. Open Group Certified Master IT Architect. Sun Certified Architect (SCEA).
Thomas Kol
Greenhorn

Joined: Jul 30, 2001
Posts: 4
better?
Ajith Kallambella
Sheriff

Joined: Mar 17, 2000
Posts: 5782
Thanks!
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: showing dynamic images with xml/xsl