Click to See Complete Forum and Search --> : Displaying an image using XSL


Mark Jablin
October 22nd, 2001, 11:12 AM
I am trying to display an XML document in IE5.5 using XSLT. I am having a problem displaying a .jpg file specified in the XML file. The XML looks like this:


<img src="C:\BrassDev\GUI\Pier\Working\Images\FootingBeamShear.jpg" width="447" height="235">


My XSL is as follows:





Except the spaces after , this is displayed in IE5.5 as:



How can I get the image displayed instead of the text? If I copy this out of the browser and insert it in an HTML document, or if I remove the spaces above, it displays properly. What am I missing? Thanks for your help.

telozo
January 9th, 2002, 04:28 PM
Instead of value-of try copy-of.

pjpark
January 9th, 2002, 06:42 PM
Another thing you could try:


&ltIMAGE_FILE
src="C:\BrassDev...and so on....jpg"
width="447"
height="235"/>

<p>
<img>
<xsl:attribute name="src"><xsl:value-of select="IMAGE_FILE/@src" />
<xsl:attribute name="width"><xsl:value-of select="IMAGE_FILE/@width" />
<xsl:attribute name="height"><xsl:value-of select="IMAGE_FILE/@height" />
</img>
</p>

Mark Jablin
January 10th, 2002, 10:05 AM
That worked great. Thanks for your help.

Mark Jablin
January 10th, 2002, 10:06 AM
I get the same problem with copy-of as I had with value-of. Thanks for your time.