kipl20
asked on
how do i pass an image source over from xml using xslt?
hi,
i am trying to get an image to display in a table on a html page generated by an xsl dcoument.
i am using this line <img> <img src="untitled.bmp"> </img>
but it will convert the same over in the generated html page. how do i send over the < and > tags so they are formetted for html?
thanks in advance
i am trying to get an image to display in a table on a html page generated by an xsl dcoument.
i am using this line <img> <img src="untitled.bmp"> </img>
but it will convert the same over in the generated html page. how do i send over the < and > tags so they are formetted for html?
thanks in advance
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
If this is your XSLT:
you should not try to make elements out of text in XML/XSLT. Instead, just declare them as elements and you should be fine.
<xsl:template match="/"> <img> <img src="untitled.bmp"> </img></xsl:template>
then indeed you will have the behavior you mentioned. Instead, try this:
<xsl:template match="/"> <img src="untitled.bmp" /> </xsl:template>
you should not try to make elements out of text in XML/XSLT. Instead, just declare them as elements and you should be fine.
welcome
aha, that was quick, Geert! Answered and accepted while I was still typing ;-)
And I see now that the resolved bugs of EE did not really work with > etc. I meant the following (for completeness sake, though the original problem was already solved):
And I see now that the resolved bugs of EE did not really work with > etc. I meant the following (for completeness sake, though the original problem was already solved):
<!-- wrong -->
<xsl:template match="/">
<img> <img src="untitled.bmp"> </img>
</xsl:template>
<!-- correct -->
<xsl:template match="/">
<img src="untitled.bmp" />
</xsl:template>
ASKER
i used this
<td><xsl:value-of select="img" disable-output-escaping="y