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 in XML. Bookmark the permalink.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>