![]() |
|
|
|
| ||||||
|
Welcome to the The ProgrammersTalk Community forums. You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today! If you have any problems with the registration process or your account login, please contact contact us. |
| Tags: |
![]() |
![]() | | LinkBack | Thread Tools | Display Modes | ![]() |
| |||
| [SOLVED] Display image using XSLT? Hi, I am new to XSLT and I have an XML file in the format given below. For each item, I would like to diplay the img as a thumbnail (with the src from XML) and the title next to the image in each line: ================ <?xml version="1.0" encoding="ISO-8859-1"?> <?xml-stylesheet type="text/xsl" href="test3.xsl"?> <html xmlns sl="http://www.w3.org/1999/XSL/Transform" xsl:version="1.0"><item> <title>CNN Title </title> <link>http://www.cnn.com</link> <description><img src="cnnImage.jpg" />This is CNN home page</description> </item> <item> <title>Yahoo title</title> <link>http://www.yahoo.com</link> <description><img src="yahooImage.jpg" />This is yahoo home page</description> </item> </html> ============== My code is this, however the image is not being displayed: ---------------------------- <xsl:stylesheet version="1.0" xmlns sl="http://www.w3.org/1999/XSL/Transform"><xsl:output method="html" /> <xsl:template match="/"> <link rel=" |
| |
| |||
| You got chopped! the normal way to do this is with lots of template match's one for each tag you may find, and ba da bing... it becomes html. Since the xml is a classic rss feed, you should be able to find some examples on google code search http://www.google.com/codesearch?q=lang%3Axsl+rss+to+html&hl=en&btnG=Sea rch+Code I like http://www.google.com/codesearch?hl=en&q=+lang sl+rss+to+html+img+show: tPyWu_HbEGk:6XGVzkUVwkE:Lod1xOjIDqY&sa=N&cd=13&ct= rc&cs_p=http://www.borho.net/news/src/phpNewsfork_0_1.tar.gz&cs_f=rss.xsl#a0but I would do the entire transform with just template matches. |
![]() |
| Thread Tools | |
| Display Modes | |
| |