Altova Mailing List Archives>Archive Index >comp.text.xml Archive Home >Recent entries >Thread Prev - I want to have an empty textarea >Thread Next - Re: I want to have an empty textarea Re: I want to have an empty textareaTo: NULL Date: 2/8/2007 2:12:00 PM
On Feb 8, 11:23 pm, Cecil Westerhof <d...@dummy.nl> wrote:
> This is a piece of code from a xslt-file:
>
> <xsl:template match="SMS">
> <xsl:for-each select='.'>
As a side note, this is one of the silliest things I've
ever seen and a textbook case of magical thinking in
coding. It's not that I've never invoked foo to do bar
without understanding either foo or bar--I did, but after
being painfully bitten on my backside by that a few times
I just said no.
> <tr>
> <td class = "inputDescription"><xsl:value-of
> select='.' />:</td>
> <td><textarea class = "content" id = "{@id}"
> rows="5" cols="50">#</textarea></td>
> </tr>
> </xsl:for-each>
> </xsl:template>
>
> When I remove the '#' to get an empty textare, the endtag
> is collapsed into the begintag and all the HTML code
> after the textarea is displayed into the textare. How can
> I get an empty textarea?
You do get an empty textarea element, it is just being
serialized as XML. There are a few possible causes for
this:
- you might've forgotten to set <xsl:output method="html"
... /> in your transformation. If this is the case, the
fix should be obvious.
- your XSLT processor doesn't grok <xsl:output method=
"html" ... /> and blissfully serializes the resulting
tree as XML anyway. If this is the case, change your
XSLT processor.
- you're attempting to output XHTML1.0, but then serve it
as text/html anyway. Basically, XSLT processors couldn't
care less for workarounds described in W3C
recommendation to ensure backwards compatibility, and
without employing those workarounds you cannot serve
XHTML as text/html (and you shouldn't anyway if you care
for your sanity and general well-being one bit). If this
is the case, just output HTML4.01 instead (there might
be other solutions, but I won't go into that).
--
roy axenov
| ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
