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"/>

This entry was posted on Thursday, January 20th, 2005 at 01:15 and is filed under XML. You can follow any responses to this entry through the RSS 2.0 feed. Both comments and pings are currently closed.

Comments are closed.