This is the mail archive of the
xsl-list@mulberrytech.com
mailing list .
Re: Html tags as part of XML elements rendered as text
If you're dying to keep your input xml data in this form, you might try
adding the disable-output-escaping="yes" attribute to the <xsl:value-of
select="text"/> element. Although implementation is optional, it will
probably work.
The more preferred solution would be to see if you can change your input
XML document to something more XML-like:
<text><font face="helvetica" size="2"><b>this thing
costs</b><br>$219.00</br></font></text>
Then, you could change the <xsl:value-of select="text"> to
<xsl:copy-of select="text/*">
HTH,
Gary
"Erickson, David" wrote:
>
> I use an XSL stylesheet to parse an XML document into html. The problem is
> that one of the XML elements contains HTML tags and the stylesheet renders
> it as text in IE5. Below is the XML element:
>
> <?xml version = "1.0"?>
> <root_node>
> <child_node>
> <category>1011</category>
>
> <target>http://www.mysite.com/script.fgi?cat=1011&uid=2000204484&tim
> eid=1668</target>
> <image>http://www.mysite.com/img/image.jpg</image>
> <link><font face=helvetica size=2><b>this thing
> costs</b><br>$219.00</font></text>
> </child_node>
> </root_node>
>
> This is a portion of the XSL document I am using to parse this XML:
>
> <a><xsl:attribute name="href"><xsl:value-of select="target"/>
> </xsl:attribute>Target!!!</a>
>
> <img><xsl:attribute name="src">
> <xsl:value-of select="image"/>
> </xsl:attribute></img>
>
> <xsl:value-of select="text"/>
>
> The 1st one renders a hypertext link, the 2nd an image. The 3rd renders the
> contents of <text> literally.
>
> I need to have <text> rendered as it looks like it should, as HTML with the
> <font> and other elements used
> in the resultant rendered HTML. I've looked everywhere for an example of
> this, but no luck.
>
> Any suggestions?
>
> Dave -
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list