Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
XML
data.xmlanalysis
mappoint.webservice
msf
msxml-webrelease
netmyservices.sdk
passport.sdk
soap
soapsdk
uddi.general
uddi.programming
uddi.specification
xml
xmlsqlwebrelease
xsl
  
 
date: Sat, 19 Apr 2008 23:32:00 -0700,    group: microsoft.public.xsl        back       


Trouble displaying an image - please help   
Hello, I'm new to the world of xml xsl and ccs, but I'm trying to give it a 
go.  I seem to be having a problem loading an image defined in my xml file as:

<character>
	<portrait>../../virgilart/WorkingOnIt/sphere-01.jpg</portrait>
...
<character>

I retrieve the value in my xsl and trim off the ../ with the following:

	<xsl:variable name="portrait-image">
			<xsl:call-template name="left-trim-all">
			  <xsl:with-param name="text" select="character/portrait"/>
			  <xsl:with-param name="target" select="'../'"/>
			</xsl:call-template>
	</xsl:variable>

Then I try to display it in a table with:

<img src="($portrait-image)" width="175" height="175"/>

... but it won't display.  So, I replace the line above with another line to 
see if it is returning the correct string:

<xsl:value-of select="($portrait-image)" />

returns: virgilart/WorkingOnIt/sphere-01.jpg, which is what I want, since 
the virgilart folder is a subfolder of where the xsl and xml files are 
located.

if I hard code the value into my xsl file, the image works fine.  Eg:

<img src="virgilart/WorkingOnIt/sphere-01.jpg" width="175" height="175"/>

displays my image beautifully.  But I can't leave it like this because each 
time the xml file will have a different image.

What am I doing wrong?

Thanks in advance.

Nigel
date: Sat, 19 Apr 2008 23:32:00 -0700   author:   Nigel

Re: Trouble displaying an image - please help   
Nigel wrote:

> Then I try to display it in a table with:
> 
> <img src="($portrait-image)" width="175" height="175"/>

Attribute value templates use {} not () so you need
   <img src="{$portrait-image}" width="175" height="175"/>

-- 

	Martin Honnen --- MVP XML
	http://JavaScript.FAQTs.com/
date: Sun, 20 Apr 2008 14:32:58 +0200   author:   Martin Honnen

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us