cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Justin Fagnani-Bell <jus...@paraliansoftware.com>
Subject Re: Keeping HTMLSerializer from altering markup?
Date Fri, 09 Aug 2002 08:12:03 GMT
Thanks for the replies guys, unfortunately I'm still kinda stuck.

I tried the xhtml serializer (which is really an xml serializer) and the 
xml serializer They almost work, but not quite. First, Mozilla 1.0 won't 
render tables correctly (<td> bgcolor attribute, though Chimera renders 
fine) for some reason. More importantly they turn an empty set of tags 
(ie. <textarea></textarea>) into one tag (<textarea/>) which is fine for

most tags, but for textarea (in Mozilla at least) it causes the text 
field to be filled with the contents of the html file after the 
<textarea/> tag to the end of file.

I'm not sure whether <textarea/> is correct in XHTML. If it's not then 
this could probably be called a bug in an xhtml serializer, even though 
this makes sense in terms of xml. If it is correct (which i suspect) 
then it's a bug in Mozilla. Either way it's a PITA.

One solution might be to turn off combining empty tags in the xml 
serializer. Is there a way to do this? There's no docs on the 
cofiguration parameters for any of the serializers, and I'm a little 
confused by the source. It looks like XMLSerializer, and HTMLSerializer 
(through AbstractTextSerializer) get a transformer to do the conversion, 
and pass a bunch of parameters to it. I assume method is the xslt output 
method, but what is cdata-section-elements? Could it be of use to me 
here?

Another thing I tried was using a TextSerializer, with the mime-type set 
to text/html. I figured that for text output it wouldn't mess with the 
tags, only problem was that mozilla wouldn't render any of the tags, 
just the text. This is probably because of a namepsace or dtd issue and 
I'm gonna try to fix it.

Justin

oh yeah, on more thing that may be important. I'm using cocoon 2.0.1. It 
didn't include an xhtml entry in <map:serializers> so I copied it from 
2.0.3. If the serializers behave differently that could be an issue, but 
I don't think I can upgrade right now. I'll see.

On Friday, August 9, 2002, at 12:42 AM, KOZLOV Roman wrote:

> Hi,
>
> Just a question, if XHTML is XML then is it possible to use XML 
> serializer?
> If not, why?
>
> Roman
>
> Vadim Gritsenko wrote:
>
>>> From: Justin Fagnani-Bell [mailto:justin@paraliansoftware.com]
>>>
>>> Hi list,
>>>
>>>   I have a page with a form generated by Cocoon. There's a textarea in
>>> the form where you can edit some xml (possibly xhtml). Because the
>> form
>>> is an HTML form I'm using an HTMLSerializer. But I want to keep the
>>> serializer from altering the markup in the textarea, because if it's
>>> xhtml content it will turn <br/>'s into <br>'s. Then when the text
is
>>> saved and you visit the form again, or view the page the text is on, I
>>> get a parsing error.

<snip>

>> Try xhtml serializer, it comes with default sitemap.
>>
>> Vadim
>>


---------------------------------------------------------------------
Please check that your question  has not already been answered in the
FAQ before posting.     <http://xml.apache.org/cocoon/faq/index.html>

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


Mime
View raw message