Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries [Thread Prev] >Thread Next - Re: using html in variables using html in variablesTo: NULL Date: 8/5/2008 9:03:00 AM So, I'm having a bit of a time trying to insert an <img> tag into an
<a> tag using an xsl variable. Consider the following template. The
contents of the foo variable doesn't show up in the anchor. When I use
named entities instead of < and >, it gets inserted just fine although
then it's not interpreted by the browser but, rather, simply included
as is in the page content.
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/
Transform">
<xsl:output method="html" version="4.0" />
<xsl:template match="foo">
<xsl:variable name="bar">
<xsl:if test="$some-boolean-variable">
<img src="http://some-image.gif" border="0" width="7" height="7"/>
</xsl:if>
</xsl:variable>
<a href="some-url.html" title="{title}"><xsl:value-of select="title"/
><xsl:value-of select="$bar"/></a>
</xsl:template>
</xsl:stylesheet>
Any help on this would be greatly appreciated!
David
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
