Sorry to bug you again. If there's any chance of help I've tried calling an image in with xslt and I can't get it to work.
Here are the files I have:
image.xml:
---------------------------------------
<?xml version="1.0" ?>
<?xml-stylesheet type="text/xsl" href="image.xsl" ?>
<!-- Here, I want to figure out the best way to get an image from xml -->
<images>
<image>
<filename>image.jpg</filename>
</image>
</images>
---------------------------------------
image.xsl:
---------------------------------------
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" indent="yes"/>
<xsl:variable name="source">
<xsl:value-of select="./filename" />
</xsl:variable>
<xsl:template match="images">
<html>
<body>
<xsl:apply-templates/>
</body>
</html>
</xsl:template>
<xsl:template match="//image">
Before Image
<img src="${source}" width="50" height="50" border="1" /> After Image
</xsl:template>
</xsl:stylesheet>
---------------------------------------
When I view this in Netscape 6.2, it appears that the image is being created but the variable source is not evaluating (I get the text before and after the html <img> tag and the border of the image but no image).
I tried calling the image in using <img src="$source" width="50" height="50" border="1" /> (no curly braces) but to no avail.
Could please help me this just so I can get started?
Thank you so much,
Bennett
On Thursday, July 18, 2002, at 12:26 PM, Joseph Kesselman wrote:
Uhm. We should keep this on the mailing list. (I meant to send my response to the list; apologies if I sent it only to you by accident.)
> I'm not quite sure I'm clear on the difference that you're stating
> here. Are you trying to say if the answer is " the image is part of your style
> use CSS but if it's part of your content use XSLT or something different?
No. I'm just pointing out that images may be part of your document content (a photo of a product in an electronic catalog, for example), or part of your style (eg a company logo which appears on every page of the catalog).
> Do you know of any examples of the how to handle the difference between the two
> scenarios?
If I had examples handy, I would have cited them.
> Is there a way to do this with XSLT 1.0? If so, could you provide an
> example if I were to define a tag called <image>?
XSLT 1.0 is not aware of schema datatypes. But if you define a tag called <image> you can certainly write a stylesheet which matches on that tagname and processess it appropriately... it's just your responsibility to keep your document design and your stylesheet in synch.
______________________________________
Joe Kesselman / IBM Research
