I have a table that should display an image on the left and the corresponding description on the right. With the following code in IE 6.0 all works well - with Mozilla, I get the path to my image displayed as text--not the image, and on the right the description is displayed as it should be. I tried to change my code according to sample code from the W3c.org site--and I understand what the code is doing--but it fails in both IE 6.0 and Mozilla. IE states that ""A reference to variable or parameter 'image-dir' cannot be resolved. The variable or parameter may not be defined, or it may not be in scope."" MOZILLA's error---Error during XSLT transformation: (null)--- Right now I'm testing a simple table that will display only an image -
XML FILE.............
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="photo.xsl"?>
<photograph>
<href>hats.jpg</href>
<size width="300"/>
</photograph>
.................................
XSL FILE........................
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl=" <xsl:template match="/">
<html>
<body bgcolor="#FFFFCC">
<h2 align="center">INVENTORY ITEM</h2>
<table border="1">
<tr bgcolor="#0066FF">
<th align="center">IMAGE</th>
<th align="center">DESCRIPTION</th>
</tr>
<tr>
<td>
<xsl:variable name="image-dir">/WebsphereWork/images</xsl:variable>
<xsl:apply-templates select="photograph" />
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="photograph">
<img src="{$image-dir}/{href}" width="{size/@width}" />
</xsl:template>
</xsl:stylesheet>
...................................................
Any pointers on my continuing IE6/Mozilla dilemma.....
cramd
XML FILE.............
<?xml version="1.0" encoding="ISO-8859-1"?>
<?xml-stylesheet type="text/xsl" href="photo.xsl"?>
<photograph>
<href>hats.jpg</href>
<size width="300"/>
</photograph>
.................................
XSL FILE........................
<?xml version="1.0" encoding="ISO-8859-1" ?>
<xsl:stylesheet version="1.0" xmlns:xsl=" <xsl:template match="/">
<html>
<body bgcolor="#FFFFCC">
<h2 align="center">INVENTORY ITEM</h2>
<table border="1">
<tr bgcolor="#0066FF">
<th align="center">IMAGE</th>
<th align="center">DESCRIPTION</th>
</tr>
<tr>
<td>
<xsl:variable name="image-dir">/WebsphereWork/images</xsl:variable>
<xsl:apply-templates select="photograph" />
</td>
</tr>
</table>
</body>
</html>
</xsl:template>
<xsl:template match="photograph">
<img src="{$image-dir}/{href}" width="{size/@width}" />
</xsl:template>
</xsl:stylesheet>
...................................................
Any pointers on my continuing IE6/Mozilla dilemma.....
cramd