Maybe I read the code the wrong way. What I understood was:

   public void endElementImpl(String uri, String local, String qual) throws SAXException {
[...]
        if (XHTML1_NAMESPACE.equals(uri)) {
            if ((local.equalsIgnoreCase("textarea")) ||
                (local.equalsIgnoreCase("script")) ||
                (local.equalsIgnoreCase("style"))) {
                this.closeElement(false); // This line should cause the [<script] to become [<script>]
            } else if (local.equalsIgnoreCase("head")) {
[...]
            }
        }
        super.endElementImpl(uri, local, qual); // And thus this line should close the element with [</script>]
    }

So my proposal would be to add a line like
(local.equalsIgnoreCase("div")) ||
for each element that should share this behaviour.

BTW, the source I am looking at is the one in Cocoon 2.1.7. I checked on http://svn.apache.org/repos/asf/cocoon/blocks/serializers/trunk/java/org/apache/cocoon/components/serializers/XHTMLSerializer.java
and the relevant part of the code is the same.

--
Antonio


2005/8/2, Kees Broenink <kees.broenink@backbase.com>:
Hello,

Adding to this is an issue with IE and the <script> tag. I did not
search the mail archive nor bugzilla, so maybe it is already addressed
for the next release.

The xhtml serializer will change
  <script type="text/javascript" src="/bxs/3_0_1/bpc/boot.js"></script>
into
  <script type="text/javascript" src="/bxs/3_0_1/bpc/boot.js"/>

This will break loading the JS in IE.

Kees


-----Oorspronkelijk bericht-----
Van: Antonio Fiol Bonnín [mailto:antonio.fiol@gmail.com]
Verzonden: Tuesday, August 02, 2005 11:26 AM
Aan: dev@cocoon.apache.org
Onderwerp: Suggestion for XHTMLSerializer


Hello,

I am finding a problem with empty elements when serving content with the
text/html content type on Firefox. For example, collapsed empty div
elements cause havoc in firefox. A possible workaround would be
implementing the compatibility guidelines indicated in the W3C
recommendations.

In particular, I would add the same check already present for style,
script and textarea for any element whose end tag is required in HTML
4.01.

Would a patch for this be welcome?

Yours,

--
Antonio