Tim Van Wassenhove

Passionate geek, interested in Technology. Proud father of two

20 Jan 2005

XSLT annoyances

Today i’ve finally made the switch. My code generates XML and then i translate it to XHTML with XSLT. However, if i write

<textarea name="foo"></textarea>

it will be translated to:

<textarea name="foo" />.

A not so good workaround is to write: (Notice the space in the xsl:text)

<textarea name="foo"><xsl:text> </xsl:text></textarea>

UPDATE on 2005-01-20 05:42

The solution is to use html as output method instead of xml.

<xsl:output method='html'/>

UPDATE on 2005-01-21 02:15

You may also want to make sure HTML tags do not get transformed:

<xsl:value-of select="attribute[@name='content']" disable-output-escaping="yes"/>