cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan Hoskens ...@schaubroeck.be>
Subject Re: textarea in xhtml
Date Tue, 15 Mar 2005 10:37:21 GMT
Hi,

There's a little bit more you need to know about textarea and xhtml. Try to follow me on this
one ;-)

If you are getting problems with a textarea under IE(or another browser) it's because you
think you 
are serializing to xhtml but in fact you're sending plain html. First you need to know that
IE 6 as 
it is now, doesn't support xhtml. If you're sending 'real' xhtml to IE it will ask the user
to 
download the page. If you're not bothered by this IE problem, you can send xhtml by serializing
to 
xml AND set the correct mime-type: application/xhtml+xml in that serializer (look at your

serializers part in the sitemap, mime-type should be an attribute on your xhtml serializer
tag). 
Firefox or other xhtml capable browsers will then see this page as xhtml and do render the
<textarea 
/> tag correctly.

What you're probably doing right now is setting everything correct to serve xhtml, serialize
it as 
xhtml, but sending the wrong mime-type: text/html. This isn't a big problem as explained in
[1] 
because xhtml 1.0 is almost the same as html except for eg that textarea tag. It's stated
in html 
that there must be an end tag for textarea and because your page is viewed as text/html your
browser 
chokes on <textarea />. This means in every browser (also eg firefox) as they don't
get the correct 
mime-type. But as said, the most used browser IE 6 isn't capable of rendering xhtml correctly.

So you'll need to do one of the following:
1) render as xhtml with correct mime type application/xhtml+xml BUT loose IE users (bad choice
to me)
2) render as html, mime-type text/html (rewrite page(s)? ~ take a step back?)
3) render textarea's with a space: <textarea> </textarea> and use xhtml with mime-type
text/html 
(but maybe not that nice)

I'm not sure there's another way to solve this. I once thought of extending the xml serializer
and 
somehow make sure the tags all have an end-tag, but Xalan (or whatever you are using) is serializing

the xml output and doesn't have a setting not to collapse empty elements. (if I'm wrong, please
do 
correct me!)

[1]http://www.w3.org/MarkUp/2004/xhtml-faq#texthtml

Kind Regards,
Jan


Derek Hohls wrote:
> Gunter
> 
> That's strange - the output I get in my HTML forms page 
> (in IE) looks like:
> 
> <input type="text" title="test" value="2002-08-15" name="CalDate">
> 
> ie there is no "/" at the end...
> 
> The input in the XML file is 
> <input type="text" title="test" value="2002-08-15" name="CalDate"/>
> but admittedly there is no XSL step apart from the standard
> "copy tag" match.  Maybe its your XSL that is the problem?  Can
> you try and change to create: 
> <textarea name="mynote"/>
> 
> Derek
> 
> 
>>>>gunter.dhondt@sofico.be 2005/03/15 11:42:50 AM >>>
> 
> Hi,
> 
> I've got the following problem inside a xslt running on Cocoon:
> <textarea name="mynote"></textarea>
> 
> which is serialized into <textarea name="mynote" />
> and the problem with this is that browsers (likes IE6) do not
> understand 
> this syntax very well.
> 
> if I'm placing a space in between (<textarea name="mynote">
> </textarea>) 
> then it's ok but this is not a nice workaround
> 
> Can I choose another serializer for this problem or are there any known
> 
> workarounds for this?
> 
> Regards,
> Gunter D'Hondt
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org 
> For additional commands, e-mail: users-help@cocoon.apache.org 
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message