Wrox Programmer Forums
Go Back   Wrox Programmer Forums > XML > XSLT
|
XSLT General questions and answers about XSLT. For issues strictly specific to the book XSLT 1.1 Programmers Reference, please post to that forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the XSLT section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old December 7th, 2005, 08:30 AM
Registered User
 
Join Date: Dec 2005
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default images with xslt

hello,
I am working on a project which involves xslt 2.0 where I have a structure.xml, stylesheet.xsl and a products.xml which when used with <xsl:result-document> creates a number of pages. eveything is working fine except for trying to display images, which has me completely stumped. here is some coe from my procducts.xml file:

<product>
    <usedin section_title="computers" subsection="desktops"/>
    <description> Dell Whoopie Do</description>
    <price>£399.99 inc vat and deliviery</price>
    <img src="{/images/athlon64small.jpg}"/>
</product>

the description and price data is displaying ok by I cannot for the life of me work the syntax for displaying an image from a file. I have tried other methods, including the following:

<img><xsl:attribute name="src=">
<xsl:value-of select="concat('images/','athlon64small.jpg')"/></xsl:attribute>
<xsl:value-of select="@name"/></img>

if anyone could possibly shed eom light on this, I may have some hair left for christmas :)



chris
 
Old December 8th, 2005, 05:42 AM
Authorized User
 
Join Date: Oct 2005
Posts: 72
Thanks: 0
Thanked 0 Times in 0 Posts
Default

is it not 'images\' rather than 'images/'?
are you working in a linux environment?

 
Old December 9th, 2005, 05:36 AM
joefawcett's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Does your source XML really have braces around the image path?
If not then when you match a product you need:
Code:
<img src="{img/@src}" />
If it does have the braces you will need to remove these, one way would be using the string functions.

http://msdn.microsoft.com/library/de...asp?frame=true


--

Joe (Microsoft MVP - XML)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Load Images from and Save Images to a Database cyndie VB.NET 2 August 17th, 2008 06:42 AM
Rendering base64 images from XML in XSLT jilly XSLT 7 June 29th, 2007 07:56 AM
dynamic xslt -> xslt creation namespace problem jkmyoung XSLT 2 July 15th, 2006 12:42 AM
Rendering images with XSLT trufla XSLT 1 May 21st, 2006 11:37 AM
XSLT and images humour XSLT 1 June 22nd, 2005 01:37 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.