Andrew Madu wrote:
Hi,
my site can now be viewed at www.beyarecords.com <http://www.beyarecords.com>. I have changed my ajax-request block to xhtml. On clicking the submit button you will see that the whole page reloads!

I am using the very latest version of cocoon on winXP/SP2.


Thanks for making that available, it helps a lot.

The problem is that all the script tags are being collapsed:

<script ... />
instead of
<script ...></script>

Browsers don't handle this well, and end up not loading a bunch of the scripts, causing the errors you see.

The XHTMLSerializer in the 'serializers' block contains special logic to prevent collapsing the script elements. Unfortunately you're not using that, you are using the default xhtml serializer which really just uses XMLSerializer (notice the src="org.apache.cocoon.serialization.XMLSerializer" in its definition).

You should switch to the one in the serializers block, like so:

<map:serializer name="xhtml"
src="org.apache.cocoon.components.serializers.XHTMLSerializer" mime-type="text/html">
   <encoding>UTF-8</encoding>
   <doctype-default>strict</doctype-default>
</map:serializer>

More details on its configuration: http://cocoon.apache.org/2.1/apidocs/org/apache/cocoon/components/serializers/XHTMLSerializer.html

That should clear up your issues.
--Jason

BTW I also noticed your page's root element is <page> rather than <html>, and there are several stray <included> and <content> elements.


--
Regards

Andrew

On 10/03/07, *Andrew Madu* < [EMAIL PROTECTED] <mailto:[EMAIL PROTECTED]>> wrote:

    Hi Jason,
    sorry for the delay. I am using the


        Let's clarify... which XHTML serializer are you using?  The
        "built-in"
one, or the one in the serializers block?


    I am using the XHTML serializer in the serializers block:

    <map:serializer logger="sitemap.serializer.xhtml"
    mime-type="text/html" name="xhtml" pool-max="${
    xhtml-serializer.pool-max}"
    src="org.apache.cocoon.serialization.XMLSerializer">
          <doctype-public>-//W3C//DTD XHTML 1.0 Strict//EN</doctype-public>
          <doctype-system>
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd</doctype-system>
          <encoding>ISO-8859-1</encoding>
          <omit-xml-declaration>yes</omit-xml-declaration>
        </map:serializer>

    And here is my ajax-request block:

                <map:match pattern="**viewform-*.xml">
                    <map:generate type="newjx" src="jx/{2}.jx"/>
                    <map:transform type="cinclude"/>
                    <map:transform type="xslt-saxon" src="style/{2}.xsl"/>
                    <map:transform type="cinclude"/>
                    <map:transform type="browser-update"/>
                    <map:transform type="i18n">
                      <map:parameter name="locale" value="en-US"/>
                    </map:transform>
                    <map:transform src="template-style/forms-
    samples-styling.xsl"/>
                    <map:transform type="i18n">
                      <map:parameter name="locale" value="en-US"/>
                    </map:transform>
                    <map:select type="ajax-request">
                      <map:when test="true">
                        <map:serialize type="xml"/>
                      </map:when>
                      <map:otherwise>
                        <map:serialize type="xhtml"/>
                      </map:otherwise>
                    </map:select>
                </map:match>
    What in-built xhtml serializer do you refer to?

    --
    Regards

    Andrew




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to