Friday, April 18, 2008

how to use xHTML tags with XSLT

on my current task i started to use XSLT heavily. i have a set of XML-files and when anybody viewing them, browser applies specified XSLT-file.

as more than i used combinations of this technologies, was very impressed how things can be done easily.

today i got some issue. i had some code portion in XML that contains xHTML tags.

XML content:

<em>err assertFalse</em>
out assertFalse
failure assertFalse(junit.SimpleTest1): error message

XSLT formatting:

<xsl:value-of select="output"/>

so i need to show this output content to user using inside xHTML tags, so first line expected to be emphasized. but it not! all because, XSL processor escaping special characters by default ("<" to "&lt;") to make valid output.

i found helpful links on Dev Shed forum. all you need, is to add disable-output-escaping="yes".

<xsl:value-of select="output" disable-output-escaping="yes"/>

btw, it's working only in IE-family and Safari. it's funny discussion at FF bugzilla started 2001-09-04 and to thus far.

Friday, April 11, 2008

get firefox or opera, not IE