You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cocoon.apache.org by Andrew <an...@gmail.com> on 2006/07/26 10:20:39 UTC

Xhtml and Ajax...no go!!

Hi,
can someone please tell me why when setting ajax="true" in my CForm and
serializing the document as xhtml (Strict) the following line in the xhtml
output should break the page?:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE page PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
.........

<form action="updateAccounts.kont" ajax="true" name="Form1"
method="POST" dojoType="CFormsForm">
<script type="text/javascript">cocoon.forms.ajax = true;</script>

What is it about the script line that xhtml does not like? My ajax map is:

				<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>

If I change the forms-styling-*.xsl document to an indclude js file.
<script src="" />, which contains that one line of js,
the page loads correctly but a js error is generated saying that
'cocoon' is undefined. At this point, of course, no ajax works
and what you are left with on submitting a page is a full page reload!!

Any ideas anyone?

regards

Andrew

Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Hi Jason,


It looks like you're running from an unexploded WAR?  Perhaps that's an
> important detail.  Can you try running it exploded and see if that helps?



No, there was no change with running the project as an exploded war.

--
Regards

Andrew

Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Hi Jason,
many thanks for you reply


With all due respect to you, Jörg is just doing his best to help you out
> here.  It isn't clear yet whether this problem is within Cocoon or
> something on your end, so hooking up the debugger is simply a way to
> help track down an issue that nobody but you seems to be seeing.  We
> can't do it for you, and refusing to do so only hurts your chances of
> finding and fixing the problem.
>
> Remember that this is an open source community, and we're all
> volunteers, giving up time on our weekends to help you out for free.  If
> you're not willing to do the necessary legwork it's unlikely your
> problem will get solved.



I appreciate the help and suggestions I have received from everyone without
exception.

--
Regards

Andrew

Re: Xhtml and Ajax...no go!!

Posted by Jason Johnston <co...@lojjic.net>.
Andrew Madu wrote:
> Hi,
> for what it's worth my Jboss logs seem to be more helpfull in 
> pinpointing the source of the problem!:
> 
> Caused by: 
> org.apache.cocoon.components.serializers.encoding.CharsetFactory$CharsetFactoryException: 
> Unable to access JAR "jar:file:/C:/Program Files/jboss- 
> 4.0.3/server/default/deploy/jbossweb-tomcat55.sar/ROOT.war/WEB-INF/lib/cocoon-serializers-charsets-0.2.jar!/org/apache/cocoon/components/serializers/encoding/cs_US_ASCII.class"

It looks like you're running from an unexploded WAR?  Perhaps that's an 
important detail.  Can you try running it exploded and see if that helps?

>     with all due respect to your good self, I am trying to meet a
>     deadline here for my company website I am 'trying' to get off the
>     ground. I have had enough headache  just debugging my own code and
>     the last thing I am going to attempt at this juncture is to debug
>     Apache cocoon code which should already work!

With all due respect to you, Jörg is just doing his best to help you out 
here.  It isn't clear yet whether this problem is within Cocoon or 
something on your end, so hooking up the debugger is simply a way to 
help track down an issue that nobody but you seems to be seeing.  We 
can't do it for you, and refusing to do so only hurts your chances of 
finding and fixing the problem.

Remember that this is an open source community, and we're all 
volunteers, giving up time on our weekends to help you out for free.  If 
you're not willing to do the necessary legwork it's unlikely your 
problem will get solved.


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


Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Hi,
seems the problem is situated around this little snippet of code:

    private static final String CHARSET_LOOKUP_CLASS =

"org/apache/cocoon/components/serializers/encoding/cs_US_ASCII.class";

   .......

    private CharsetFactory() {
        super();
        this.unknownCharset = new UnknownCharset();

        ClassLoader loader = Thread.currentThread().getContextClassLoader();
        URL url = loader.getResource(CHARSET_LOOKUP_CLASS);

        ......

    private void loadCharsetsFromJar(URL url) {
        try {
            String file = url.getFile();
            String mtch = file.substring(file.indexOf('!'));
            file = file.substring(5, file.indexOf('!'));
            mtch = mtch.substring(2, mtch.lastIndexOf('/') + 1) + "cs_";

            ZipFile zip = new ZipFile(file);
            Enumeration enumeration = zip.entries();
            while (enumeration.hasMoreElements()) {
                ZipEntry entry = (ZipEntry)enumeration.nextElement();
                String name = entry.getName();
                if ((! name.startsWith(mtch)) ||
                    (! name.endsWith(".class"))) continue;
                name = name.substring(mtch.length());
                name = ".cs_" + name.substring(0, name.length() - 6);
                name = this.getClass().getPackage().getName() + name;
                loadCharset(name);
            }
        } catch (IOException exception) {
            throw new CharsetFactoryException("Unable to access JAR \""
                                          + url.toString() + "\"",
exception);
        }
    }

As very few others are reporting any problems with this issue I am presuming
it could potentially be a permissions issue that is at work here. I have
checked the permissions of cs_US_ASCII.class and have not detected anything
wrong.

Any ideas?

--
Regards

Andrew

On 12/03/07, Bertrand Delacretaz <bd...@apache.org> wrote:
>
> On 3/12/07, Andrew Madu <an...@gmail.com> wrote:
>
> > ...it would seem that this problem:
> >
> > "Unable to access JAR "jar:file:/C:/Program Files/jboss-
> > 4.0.3/server/default/deploy/jbossweb
> > -tomcat55.sar/ROOT.war/WEB-INF/lib/cocoon-
> serializers-charsets-0.2.jar!/org/apache/cocoon/components/serializers/encoding/cs_US_ASCII.class
> "
> >
> > has been an issue for a number of years!:
>
> Sure. See http://www.codeconsult.ch/bertrand/archives/000072.html.
>
> -Bertrand
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Xhtml and Ajax...no go!!

Posted by Bertrand Delacretaz <bd...@apache.org>.
On 3/12/07, Andrew Madu <an...@gmail.com> wrote:

> ...it would seem that this problem:
>
> "Unable to access JAR "jar:file:/C:/Program Files/jboss-
> 4.0.3/server/default/deploy/jbossweb
> -tomcat55.sar/ROOT.war/WEB-INF/lib/cocoon-serializers-charsets-0.2.jar!/org/apache/cocoon/components/serializers/encoding/cs_US_ASCII.class"
>
> has been an issue for a number of years!:

Sure. See http://www.codeconsult.ch/bertrand/archives/000072.html.

-Bertrand

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


Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Hi,
it would seem that this problem:

"Unable to access JAR "jar:file:/C:/Program Files/jboss- 4.0.3
/server/default/deploy/jbossweb-tomcat55.sar/ROOT.war/WEB-INF/lib/cocoon-
serializers-charsets-0.2.jar!/org/apache/cocoon/components/serializers/encoding/cs_US_ASCII.class
"

has been an issue for a number of years!:

http://mail-archives.apache.org/mod_mbox/lenya-user/200507.mbox/%3C42D1C0C9.5030007@artifact-software.com%3E

I have been unable to detect any issues with cs_US_ASCII.class.

--
Regards

Andrew


On 11/03/07, Andrew Madu <an...@gmail.com> wrote:
>
> Hi,
> for what it's worth my Jboss logs seem to be more helpfull in pinpointing
> the source of the problem!:
>
> Caused by:
> org.apache.cocoon.components.serializers.encoding.CharsetFactory$CharsetFactoryException:Unable to access JAR "jar:file:/C:/Program Files/jboss-
> 4.0.3/server/default/deploy/jbossweb-tomcat55.sar
> /ROOT.war/WEB-INF/lib/cocoon-
> serializers-charsets-0.2.jar!/org/apache/cocoon/components/serializers/encoding/cs_US_ASCII.class
> "
>
> --
> Regards
>
> Andrew
>
> On 11/03/07, Andrew Madu <an...@gmail.com> wrote:
> >
> > Hi Jörg,
> >
> >
> > As I said: Try to find the error in the initialization of
> > > CharsetFactory. Set a break point in its constructor and see which
> > > statement goes wrong.
> >
> >
> >
> > with all due respect to your good self, I am trying to meet a deadline
> > here for my company website I am 'trying' to get off the ground. I have had
> > enough headache  just debugging my own code and the last thing I am going to
> > attempt at this juncture is to debug Apache cocoon code which should already
> > work!
> >
> > --
> > Regards
> >
> > Andrew
> >
> >
> >
>

Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Hi,
for what it's worth my Jboss logs seem to be more helpfull in pinpointing
the source of the problem!:

Caused by:
org.apache.cocoon.components.serializers.encoding.CharsetFactory$CharsetFactoryException:Unable
to access JAR "jar:file:/C:/Program Files/jboss-
4.0.3/server/default/deploy/jbossweb-tomcat55.sar
/ROOT.war/WEB-INF/lib/cocoon-
serializers-charsets-0.2.jar!/org/apache/cocoon/components/serializers/encoding/cs_US_ASCII.class
"

--
Regards

Andrew

On 11/03/07, Andrew Madu <an...@gmail.com> wrote:
>
> Hi Jörg,
>
>
> As I said: Try to find the error in the initialization of
> > CharsetFactory. Set a break point in its constructor and see which
> > statement goes wrong.
>
>
>
> with all due respect to your good self, I am trying to meet a deadline
> here for my company website I am 'trying' to get off the ground. I have had
> enough headache  just debugging my own code and the last thing I am going to
> attempt at this juncture is to debug Apache cocoon code which should already
> work!
>
> --
> Regards
>
> Andrew
>
>
>

Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Hi Jörg,


As I said: Try to find the error in the initialization of
> CharsetFactory. Set a break point in its constructor and see which
> statement goes wrong.



with all due respect to your good self, I am trying to meet a deadline here
for my company website I am 'trying' to get off the ground. I have had
enough headache  just debugging my own code and the last thing I am going to
attempt at this juncture is to debug Apache cocoon code which should already
work!

--
Regards

Andrew

Re: Xhtml and Ajax...no go!!

Posted by Joerg Heinicke <jo...@gmx.de>.
On 11.03.2007 17:56, Andrew Madu wrote:

> java.lang.ExceptionInInitializerError
>    org.apache.cocoon.components.serializers.EncodingSerializer.configure(
> EncodingSerializer.java:168)

As I said: Try to find the error in the initialization of 
CharsetFactory. Set a break point in its constructor and see which 
statement goes wrong.

Jörg

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


Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Nope!!! Back to square 1. I rebooted Jboss 4.0.3 and we're back to square
one!!:

java.lang.ExceptionInInitializerError
    org.apache.cocoon.components.serializers.EncodingSerializer.configure(
EncodingSerializer.java:168)

I am totally lost with this one!!

--
Regards

Andrew

On 11/03/07, Andrew Madu <an...@gmail.com> wrote:
>
> Also,
> the xml declaration  for xhtml is not being written into the html tag. The
> serializer jar should be doing this right?
>
> --
> regards
>
> Andrew
>
> On 11/03/07, Andrew Madu <an...@gmail.com> wrote:
> >
> > Hi,
> >
> > Ok, we're getting somewhere!! I managed to track down an alternative
> > charset jar that Jeroen Reijn sent me on 26th July 2006. I placed it into my
> > WEB-INF\lib directory and the errors have gone!!
> >
> > The only problem is the serializers jar is not doing as it is supposed
> > to do!! I have specified the xhtml serializer snippet as:
> >
> >     <map:serializer name="xhtm1" src="
> > org.apache.cocoon.components.serializers.XHTMLSerializer"
> > mime-type="text/html">
> >        <encoding>ISO-8859-1</encoding>
> >        <doctype-default>strict</doctype-default>
> >        <omit-xml-declaration>yes</omit-xml-declaration>
> >     </map:serializer>
> >
> > and on viewing the output in the browser am met with the following on
> > the first line:
> >
> > <?xml version=" 1.0" encoding="UTF-8"?>
> >
> > Firstly this line should not be displayed as I have specified omit-xml
> > as true, and secondly, encoding, UTF-8? I have specified this as
> > ISO-8859-1!! Thirdly, all of the script tags are still being collapsed:
> >
> > <script ... />
> > instead of
> > <script ...></script>
> >
> > What is going on here?
> >
> > My viewing my site ( www.beyarecords.com) will enable you to see the
> > issue.
> >
> > --
> > Regards
> >
> > Andrew
> >
> >
> > On 11/03/07, Andrew Madu < andrewmadu@gmail.com> wrote:
> > >
> > > Hi Jörg,
> > > I have had, as best as I am able to, a look at what could be causing
> > > this problem but have not found anything. I downloaded a version of the jar
> > > at the link you provided and this as well yielded no change.
> > >
> > > Any ideas?
> > >
> > > --
> > > Regards
> > >
> > > Andrew
> > >
> > > On 11/03/07, Joerg Heinicke < joerg.heinicke@gmx.de> wrote:
> > > >
> > > > On 11.03.2007 13:02, Andrew Madu wrote:
> > > >
> > > > > java.lang.NoClassDefFoundError: Could not initialize class
> > > > > org.apache.cocoon.components.serializers.encoding.CharsetFactory
> > > > >
> > > > org.apache.cocoon.components.serializers.EncodingSerializer.configure
> > > > (EncodingSerializer.java:168)
> > > >
> > > > From what I understand it is not a problem of finding the
> > > > CharsetFactory, but of loading and initializing it. CharsetFactory
> > > > holds
> > > > a static instance of itself [1, line 44]. As the instantiation
> > > > happens
> > > > on loading the class, an exception during the instantiation might
> > > > lead
> > > > to the exception stacktrace you have. Best would be to do remote
> > > > debugging so that you can see where exactly it fails on loading
> > > > CharsetFactory.
> > > >
> > > > Jörg
> > > >
> > > > [1]
> > > >
> > > > http://svn.apache.org/viewvc/cocoon/tags/cocoon-2.1/RELEASE_2_1_10/src/blocks/serializers/java/org/apache/cocoon/components/serializers/encoding/CharsetFactory.java?annotate=506006
> > > >
> > > > ---------------------------------------------------------------------
> > > >
> > > > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > > > For additional commands, e-mail: users-help@cocoon.apache.org
> > > >
> > > >
> > >
> >
>

Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Also,
the xml declaration  for xhtml is not being written into the html tag. The
serializer jar should be doing this right?

--
regards

Andrew

On 11/03/07, Andrew Madu <an...@gmail.com> wrote:
>
> Hi,
>
> Ok, we're getting somewhere!! I managed to track down an alternative
> charset jar that Jeroen Reijn sent me on 26th July 2006. I placed it into my
> WEB-INF\lib directory and the errors have gone!!
>
> The only problem is the serializers jar is not doing as it is supposed to
> do!! I have specified the xhtml serializer snippet as:
>
>     <map:serializer name="xhtm1" src="
> org.apache.cocoon.components.serializers.XHTMLSerializer"
> mime-type="text/html">
>        <encoding>ISO-8859-1</encoding>
>        <doctype-default>strict</doctype-default>
>        <omit-xml-declaration>yes</omit-xml-declaration>
>     </map:serializer>
>
> and on viewing the output in the browser am met with the following on the
> first line:
>
> <?xml version=" 1.0" encoding="UTF-8"?>
>
> Firstly this line should not be displayed as I have specified omit-xml as
> true, and secondly, encoding, UTF-8? I have specified this as ISO-8859-1!!
> Thirdly, all of the script tags are still being collapsed:
>
> <script ... />
> instead of
> <script ...></script>
>
> What is going on here?
>
> My viewing my site (www.beyarecords.com) will enable you to see the issue.
>
>
> --
> Regards
>
> Andrew
>
>
> On 11/03/07, Andrew Madu <an...@gmail.com> wrote:
> >
> > Hi Jörg,
> > I have had, as best as I am able to, a look at what could be causing
> > this problem but have not found anything. I downloaded a version of the jar
> > at the link you provided and this as well yielded no change.
> >
> > Any ideas?
> >
> > --
> > Regards
> >
> > Andrew
> >
> > On 11/03/07, Joerg Heinicke < joerg.heinicke@gmx.de> wrote:
> > >
> > > On 11.03.2007 13:02, Andrew Madu wrote:
> > >
> > > > java.lang.NoClassDefFoundError: Could not initialize class
> > > > org.apache.cocoon.components.serializers.encoding.CharsetFactory
> > > >
> > > org.apache.cocoon.components.serializers.EncodingSerializer.configure(
> > > EncodingSerializer.java:168)
> > >
> > > From what I understand it is not a problem of finding the
> > > CharsetFactory, but of loading and initializing it. CharsetFactory
> > > holds
> > > a static instance of itself [1, line 44]. As the instantiation happens
> > > on loading the class, an exception during the instantiation might lead
> > >
> > > to the exception stacktrace you have. Best would be to do remote
> > > debugging so that you can see where exactly it fails on loading
> > > CharsetFactory.
> > >
> > > Jörg
> > >
> > > [1]
> > >
> > > http://svn.apache.org/viewvc/cocoon/tags/cocoon-2.1/RELEASE_2_1_10/src/blocks/serializers/java/org/apache/cocoon/components/serializers/encoding/CharsetFactory.java?annotate=506006
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > > For additional commands, e-mail: users-help@cocoon.apache.org
> > >
> > >
> >
>

Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Hi,

Ok, we're getting somewhere!! I managed to track down an alternative charset
jar that Jeroen Reijn sent me on 26th July 2006. I placed it into my
WEB-INF\lib directory and the errors have gone!!

The only problem is the serializers jar is not doing as it is supposed to
do!! I have specified the xhtml serializer snippet as:

    <map:serializer name="xhtm1" src="
org.apache.cocoon.components.serializers.XHTMLSerializer"
mime-type="text/html">
       <encoding>ISO-8859-1</encoding>
       <doctype-default>strict</doctype-default>
       <omit-xml-declaration>yes</omit-xml-declaration>
    </map:serializer>

and on viewing the output in the browser am met with the following on the
first line:

<?xml version="1.0" encoding="UTF-8"?>

Firstly this line should not be displayed as I have specified omit-xml as
true, and secondly, encoding, UTF-8? I have specified this as ISO-8859-1!!
Thirdly, all of the script tags are still being collapsed:

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

What is going on here?

My viewing my site (www.beyarecords.com) will enable you to see the issue.

--
Regards

Andrew


On 11/03/07, Andrew Madu <an...@gmail.com> wrote:
>
> Hi Jörg,
> I have had, as best as I am able to, a look at what could be causing this
> problem but have not found anything. I downloaded a version of the jar at
> the link you provided and this as well yielded no change.
>
> Any ideas?
>
> --
> Regards
>
> Andrew
>
> On 11/03/07, Joerg Heinicke <jo...@gmx.de> wrote:
> >
> > On 11.03.2007 13:02, Andrew Madu wrote:
> >
> > > java.lang.NoClassDefFoundError: Could not initialize class
> > > org.apache.cocoon.components.serializers.encoding.CharsetFactory
> > >
> > org.apache.cocoon.components.serializers.EncodingSerializer.configure(
> > EncodingSerializer.java:168)
> >
> > From what I understand it is not a problem of finding the
> > CharsetFactory, but of loading and initializing it. CharsetFactory holds
> > a static instance of itself [1, line 44]. As the instantiation happens
> > on loading the class, an exception during the instantiation might lead
> > to the exception stacktrace you have. Best would be to do remote
> > debugging so that you can see where exactly it fails on loading
> > CharsetFactory.
> >
> > Jörg
> >
> > [1]
> >
> > http://svn.apache.org/viewvc/cocoon/tags/cocoon-2.1/RELEASE_2_1_10/src/blocks/serializers/java/org/apache/cocoon/components/serializers/encoding/CharsetFactory.java?annotate=506006
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>

Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Hi Jörg,
I have had, as best as I am able to, a look at what could be causing this
problem but have not found anything. I downloaded a version of the jar at
the link you provided and this as well yielded no change.

Any ideas?

--
Regards

Andrew

On 11/03/07, Joerg Heinicke <jo...@gmx.de> wrote:
>
> On 11.03.2007 13:02, Andrew Madu wrote:
>
> > java.lang.NoClassDefFoundError: Could not initialize class
> > org.apache.cocoon.components.serializers.encoding.CharsetFactory
> >
> org.apache.cocoon.components.serializers.EncodingSerializer.configure(
> EncodingSerializer.java:168)
>
> From what I understand it is not a problem of finding the
> CharsetFactory, but of loading and initializing it. CharsetFactory holds
> a static instance of itself [1, line 44]. As the instantiation happens
> on loading the class, an exception during the instantiation might lead
> to the exception stacktrace you have. Best would be to do remote
> debugging so that you can see where exactly it fails on loading
> CharsetFactory.
>
> Jörg
>
> [1]
>
> http://svn.apache.org/viewvc/cocoon/tags/cocoon-2.1/RELEASE_2_1_10/src/blocks/serializers/java/org/apache/cocoon/components/serializers/encoding/CharsetFactory.java?annotate=506006
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Hi,
just to mention that I have the following charset jar in my WEB-INF\lib
directory:

cocoon.serializers-charsets-0.2.jar

--
Regards

Andrew


On 10/03/07, Andrew Madu <an...@gmail.com> wrote:
>
> Hi Jason,
> many thanks for your reply. I am now getting the following error message:
>
> java.lang.NoClassDefFoundError: Could not initialize class org.apache.cocoon.components.serializers.encoding.CharsetFactory
>
>
> I checked my local.blocks (cocoon 2.1.10) file and the serializers block
> has been set to:
>
> include.block.serializers=true
>
> I checked my WEB-INF\lib directory and the cocoon-serializers-block.jarfile exists. What is the issue here?
>
> --
> Regards
>
> Andrew
>
> On 10/03/07, Jason Johnston <co...@lojjic.net> wrote:
> >
> > 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* < andrewmadu@gmail.com
> > > <mailto: andrewmadu@gmail.com>> 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.0Strict//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: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>

Re: Xhtml and Ajax...no go!!

Posted by Joerg Heinicke <jo...@gmx.de>.
On 11.03.2007 13:02, Andrew Madu wrote:

> java.lang.NoClassDefFoundError: Could not initialize class
> org.apache.cocoon.components.serializers.encoding.CharsetFactory
>     org.apache.cocoon.components.serializers.EncodingSerializer.configure(EncodingSerializer.java:168) 

 From what I understand it is not a problem of finding the 
CharsetFactory, but of loading and initializing it. CharsetFactory holds 
a static instance of itself [1, line 44]. As the instantiation happens 
on loading the class, an exception during the instantiation might lead 
to the exception stacktrace you have. Best would be to do remote 
debugging so that you can see where exactly it fails on loading 
CharsetFactory.

Jörg

[1] 
http://svn.apache.org/viewvc/cocoon/tags/cocoon-2.1/RELEASE_2_1_10/src/blocks/serializers/java/org/apache/cocoon/components/serializers/encoding/CharsetFactory.java?annotate=506006

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


Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Hi,
here is a more comprehensive error report for the issue I am trying to
resolve:

java.lang.NoClassDefFoundError: Could not initialize class
org.apache.cocoon.components.serializers.encoding.CharsetFactory
	org.apache.cocoon.components.serializers.EncodingSerializer.configure(EncodingSerializer.java:168)
	org.apache.cocoon.components.serializers.XHTMLSerializer.configure(XHTMLSerializer.java:118)
	org.apache.avalon.framework.container.ContainerUtil.configure(ContainerUtil.java:201)
	org.apache.avalon.excalibur.component.DefaultComponentFactory.newInstance(DefaultComponentFactory.java:289)
	org.apache.avalon.excalibur.pool.InstrumentedResourceLimitingPool.newPoolable(InstrumentedResourceLimitingPool.java:655)
	org.apache.avalon.excalibur.pool.InstrumentedResourceLimitingPool.get(InstrumentedResourceLimitingPool.java:371)
	org.apache.avalon.excalibur.component.PoolableComponentHandler.doGet(PoolableComponentHandler.java:198)
	org.apache.avalon.excalibur.component.ComponentHandler.get(ComponentHandler.java:381)
	org.apache.avalon.excalibur.component.ExcaliburComponentSelector.select(ExcaliburComponentSelector.java:215)
	org.apache.cocoon.components.ExtendedComponentSelector.select(ExtendedComponentSelector.java:268)
	org.apache.cocoon.components.pipeline.AbstractProcessingPipeline.setSerializer(AbstractProcessingPipeline.java:309)
	org.apache.cocoon.components.pipeline.impl.AbstractCachingProcessingPipeline.setSerializer(AbstractCachingProcessingPipeline.java:159)
	org.apache.cocoon.components.treeprocessor.sitemap.SerializeNode.invoke(SerializeNode.java:104)
	org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
	org.apache.cocoon.components.treeprocessor.sitemap.SwitchSelectNode.invoke(SwitchSelectNode.java:104)
	org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
	org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
	org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
	org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
	org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
	org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
	org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
	org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.handleCocoonRedirect(ConcreteTreeProcessor.java:299)
	org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.access$000(ConcreteTreeProcessor.java:48)
	org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor$TreeProcessorRedirector.cocoonRedirect(ConcreteTreeProcessor.java:340)
	org.apache.cocoon.environment.ForwardRedirector.redirect(ForwardRedirector.java:60)
	org.apache.cocoon.components.flow.AbstractInterpreter.forwardTo(AbstractInterpreter.java:210)
	org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.forwardTo(FOM_JavaScriptInterpreter.java:863)
	org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon.forwardTo(FOM_Cocoon.java:699)
	org.apache.cocoon.components.flow.javascript.fom.FOM_Cocoon.jsFunction_sendPage(FOM_Cocoon.java:270)
	sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
	sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
	java.lang.reflect.Method.invoke(Method.java:597)
	org.mozilla.javascript.MemberBox.invoke(MemberBox.java:149)
	org.mozilla.javascript.FunctionObject.call(FunctionObject.java:474)
	org.mozilla.javascript.Interpreter.interpretLoop(Interpreter.java:3089)
	org.mozilla.javascript.Interpreter.interpret(Interpreter.java:2255)
	org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:161)
	org.mozilla.javascript.ContextFactory.doTopCall(ContextFactory.java:386)
	org.mozilla.javascript.ScriptRuntime.doTopCall(ScriptRuntime.java:2772)
	org.mozilla.javascript.InterpretedFunction.call(InterpretedFunction.java:159)
	org.mozilla.javascript.ScriptRuntime.call(ScriptRuntime.java:917)
	org.apache.cocoon.components.flow.javascript.fom.FOM_JavaScriptInterpreter.callFunction(FOM_JavaScriptInterpreter.java:762)
	org.apache.cocoon.components.treeprocessor.sitemap.CallFunctionNode.invoke(CallFunctionNode.java:139)
	org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
	org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
	org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
	org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
	org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
	org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
	org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
	org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:177)
	org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:253)
	org.apache.cocoon.components.treeprocessor.sitemap.MountNode.invoke(MountNode.java:118)
	org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:47)
	org.apache.cocoon.components.treeprocessor.sitemap.MatchNode.invoke(MatchNode.java:108)
	org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
	org.apache.cocoon.components.treeprocessor.sitemap.PipelineNode.invoke(PipelineNode.java:143)
	org.apache.cocoon.components.treeprocessor.AbstractParentProcessingNode.invokeNodes(AbstractParentProcessingNode.java:69)
	org.apache.cocoon.components.treeprocessor.sitemap.PipelinesNode.invoke(PipelinesNode.java:93)
	org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:235)
	org.apache.cocoon.components.treeprocessor.ConcreteTreeProcessor.process(ConcreteTreeProcessor.java:177)
	org.apache.cocoon.components.treeprocessor.TreeProcessor.process(TreeProcessor.java:253)
	org.apache.cocoon.Cocoon.process(Cocoon.java:699)
	org.apache.cocoon.servlet.CocoonServlet.service(CocoonServlet.java:1154)
	javax.servlet.http.HttpServlet.service(HttpServlet.java:810)


	org.jboss.web.tomcat.filters.ReplyHeaderFilter.doFilter(ReplyHeaderFilter.java:81)


--
Regards

Andrew

On 11/03/07, Andrew Madu <an...@gmail.com> wrote:
>
> Hi Jason/All,
> would I be correct in thinking that:
>
>     <map:serializer name="xhtml" src="
> org.apache.cocoon.components.serializers.XHTMLSerializer"
> mime-type="text/html">
>        <encoding>ISO-8859-1</encoding>
>        <doctype-default>strict</doctype-default>
>     </map:serializer>
>
> works for you? If so would it be possible for you to send me a copy of
> your serializer/charsets jars? I am using cocoon 2.1.10
>
> --
> Regards
>
> Andrew
>
> On 11/03/07, Andrew Madu <an...@gmail.com> wrote:
> >
> > Hi Jason,
> > thanks for the reply. I came across this website which seems to document
> > the very issue I am having now with previous versions of cocoon...
> >
> > http://www.jarhoo.com/jarhoo/JarFileContents.do?jarFileId=3935
> >
> > --
> > Regards
> >
> > Andrew
> >
> > On 11/03/07, Jason Johnston < cocoon@lojjic.net> wrote:
> > >
> > > Andrew Madu wrote:
> > > > Hi,
> > > >
> > > >     java.lang.NoClassDefFoundError : Could not initialize class
> > > >     org.apache.cocoon.components.serializers.encoding.CharsetFactory
> > > >
> > > >
> > > > I remember having this very issue with a previous version of cocoon,
> > > but
> > > > for the lief of me I can't remember how the issue was resolved. I
> > > think
> > > > I may have been given a different charset version but I can't be
> > > sure!
> > > > Any ideas with this one?
> > >
> > > I remember seeing a discussion about this a while back too but don't
> > > remember the outcome.  You can probably find it in the list archives.
> > >
> > > >
> > > > For the meantime I will revert back to the in-built xhtml serializer
> > > > until this issue is resolved.
> > >
> > > If you do that, a possible way to work around the issue is to run a
> > > XSLT
> > > just before serializing that adds content between the script tags so
> > > they don't collapse.  Something like:
> > >
> > > <xsl:stylesheet ...>
> > >
> > >     <!-- keep script tags from collapsing -->
> > >     <xsl:template match="script">
> > >        <xsl:copy>
> > >           <xsl:copy-of select="@*" />
> > >           <xsl:apply-templates />
> > >           <xsl:text>//</xsl:text>
> > >        </xsl:copy>
> > >     </xsl:template>
> > >
> > >     <!-- copy everything else through -->
> > >     <xsl:template match="*">
> > >        <xsl:copy>
> > >           <xsl:copy-of select="@*" />
> > >           <xsl:apply-templates />
> > >        </xsl:copy>
> > >     </xsl:template>
> > >
> > > </xsl:stylesheet>
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > > For additional commands, e-mail: users-help@cocoon.apache.org
> > >
> > >
> >
>

Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Hi Jason/All,
would I be correct in thinking that:

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

works for you? If so would it be possible for you to send me a copy of your
serializer/charsets jars? I am using cocoon 2.1.10

--
Regards

Andrew

On 11/03/07, Andrew Madu <an...@gmail.com> wrote:
>
> Hi Jason,
> thanks for the reply. I came across this website which seems to document
> the very issue I am having now with previous versions of cocoon...
>
> http://www.jarhoo.com/jarhoo/JarFileContents.do?jarFileId=3935
>
> --
> Regards
>
> Andrew
>
> On 11/03/07, Jason Johnston < cocoon@lojjic.net> wrote:
> >
> > Andrew Madu wrote:
> > > Hi,
> > >
> > >     java.lang.NoClassDefFoundError : Could not initialize class
> > >     org.apache.cocoon.components.serializers.encoding.CharsetFactory
> > >
> > >
> > > I remember having this very issue with a previous version of cocoon,
> > but
> > > for the lief of me I can't remember how the issue was resolved. I
> > think
> > > I may have been given a different charset version but I can't be sure!
> > > Any ideas with this one?
> >
> > I remember seeing a discussion about this a while back too but don't
> > remember the outcome.  You can probably find it in the list archives.
> >
> > >
> > > For the meantime I will revert back to the in-built xhtml serializer
> > > until this issue is resolved.
> >
> > If you do that, a possible way to work around the issue is to run a XSLT
> > just before serializing that adds content between the script tags so
> > they don't collapse.  Something like:
> >
> > <xsl:stylesheet ...>
> >
> >     <!-- keep script tags from collapsing -->
> >     <xsl:template match="script">
> >        <xsl:copy>
> >           <xsl:copy-of select="@*" />
> >           <xsl:apply-templates />
> >           <xsl:text>//</xsl:text>
> >        </xsl:copy>
> >     </xsl:template>
> >
> >     <!-- copy everything else through -->
> >     <xsl:template match="*">
> >        <xsl:copy>
> >           <xsl:copy-of select="@*" />
> >           <xsl:apply-templates />
> >        </xsl:copy>
> >     </xsl:template>
> >
> > </xsl:stylesheet>
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>

Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Hi Jason,
thanks for the reply. I came across this website which seems to document the
very issue I am having now with previous versions of cocoon...

http://www.jarhoo.com/jarhoo/JarFileContents.do?jarFileId=3935

--
Regards

Andrew

On 11/03/07, Jason Johnston <co...@lojjic.net> wrote:
>
> Andrew Madu wrote:
> > Hi,
> >
> >     java.lang.NoClassDefFoundError : Could not initialize class
> >     org.apache.cocoon.components.serializers.encoding.CharsetFactory
> >
> >
> > I remember having this very issue with a previous version of cocoon, but
> > for the lief of me I can't remember how the issue was resolved. I think
> > I may have been given a different charset version but I can't be sure!
> > Any ideas with this one?
>
> I remember seeing a discussion about this a while back too but don't
> remember the outcome.  You can probably find it in the list archives.
>
> >
> > For the meantime I will revert back to the in-built xhtml serializer
> > until this issue is resolved.
>
> If you do that, a possible way to work around the issue is to run a XSLT
> just before serializing that adds content between the script tags so
> they don't collapse.  Something like:
>
> <xsl:stylesheet ...>
>
>     <!-- keep script tags from collapsing -->
>     <xsl:template match="script">
>        <xsl:copy>
>           <xsl:copy-of select="@*" />
>           <xsl:apply-templates />
>           <xsl:text>//</xsl:text>
>        </xsl:copy>
>     </xsl:template>
>
>     <!-- copy everything else through -->
>     <xsl:template match="*">
>        <xsl:copy>
>           <xsl:copy-of select="@*" />
>           <xsl:apply-templates />
>        </xsl:copy>
>     </xsl:template>
>
> </xsl:stylesheet>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Xhtml and Ajax...no go!!

Posted by Jason Johnston <co...@lojjic.net>.
Andrew Madu wrote:
> Hi Jason,
> many thanks for your reply. I am now getting the following error message:
> 
> java.lang.NoClassDefFoundError: Could not initialize class org.apache.cocoon.components.serializers.encoding.CharsetFactory
> 
> 
> I checked my local.blocks (cocoon 2.1.10) file and the serializers block 
> has been set to:
> 
> include.block.serializers=true
> 
> I checked my WEB-INF\lib directory and the cocoon-serializers-block.jar 
> file exists. What is the issue here?

There should also be a cocoon-serializers-charsets-0.2.jar file, is that 
there?


> 
> --
> Regards
> 
> Andrew
> 
> On 10/03/07, *Jason Johnston* <cocoon@lojjic.net 
> <ma...@lojjic.net>> wrote:
> 
>     Andrew Madu wrote:
>      > Hi,
>      > my site can now be viewed at www.beyarecords.com
>     <http://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
>     <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* < andrewmadu@gmail.com
>     <ma...@gmail.com>
>      > <mailto: andrewmadu@gmail.com <ma...@gmail.com>>> 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: users-unsubscribe@cocoon.apache.org
>     <ma...@cocoon.apache.org>
>     For additional commands, e-mail: users-help@cocoon.apache.org
>     <ma...@cocoon.apache.org>
> 
> 


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


Re: Xhtml and Ajax...no go!!

Posted by Jason Johnston <co...@lojjic.net>.
Andrew Madu wrote:
> Hi,
> 
>     java.lang.NoClassDefFoundError : Could not initialize class
>     org.apache.cocoon.components.serializers.encoding.CharsetFactory
> 
> 
> I remember having this very issue with a previous version of cocoon, but 
> for the lief of me I can't remember how the issue was resolved. I think 
> I may have been given a different charset version but I can't be sure! 
> Any ideas with this one?

I remember seeing a discussion about this a while back too but don't 
remember the outcome.  You can probably find it in the list archives.

> 
> For the meantime I will revert back to the in-built xhtml serializer 
> until this issue is resolved.

If you do that, a possible way to work around the issue is to run a XSLT 
just before serializing that adds content between the script tags so 
they don't collapse.  Something like:

<xsl:stylesheet ...>

    <!-- keep script tags from collapsing -->
    <xsl:template match="script">
       <xsl:copy>
          <xsl:copy-of select="@*" />
          <xsl:apply-templates />
          <xsl:text>//</xsl:text>
       </xsl:copy>
    </xsl:template>

    <!-- copy everything else through -->
    <xsl:template match="*">
       <xsl:copy>
          <xsl:copy-of select="@*" />
          <xsl:apply-templates />
       </xsl:copy>
    </xsl:template>

</xsl:stylesheet>

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


Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Hi,

java.lang.NoClassDefFoundError: Could not initialize class
> org.apache.cocoon.components.serializers.encoding.CharsetFactory


I remember having this very issue with a previous version of cocoon, but for
the lief of me I can't remember how the issue was resolved. I think I may
have been given a different charset version but I can't be sure! Any ideas
with this one?

For the meantime I will revert back to the in-built xhtml serializer until
this issue is resolved.

--
Regards

Andrew

Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Hi Jason,
many thanks for your reply. I am now getting the following error message:

java.lang.NoClassDefFoundError: Could not initialize class
org.apache.cocoon.components.serializers.encoding.CharsetFactory


I checked my local.blocks (cocoon 2.1.10) file and the serializers block has
been set to:

include.block.serializers=true

I checked my WEB-INF\lib directory and the cocoon-serializers-block.jar file
exists. What is the issue here?

--
Regards

Andrew

On 10/03/07, Jason Johnston <co...@lojjic.net> wrote:
>
> 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* < andrewmadu@gmail.com
> > <ma...@gmail.com>> 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.0Strict//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: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Xhtml and Ajax...no go!!

Posted by Jason Johnston <co...@lojjic.net>.
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* < andrewmadu@gmail.com 
> <ma...@gmail.com>> 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: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Hi,
my site can now be viewed at 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.

--
Regards

Andrew

On 10/03/07, Andrew Madu <an...@gmail.com> 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
>
>

Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
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

Re: Xhtml and Ajax...no go!!

Posted by Jason Johnston <co...@lojjic.net>.
Andrew Madu wrote:
> Hi,
> I have also realized that the:
> 
> xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" is not being written 
> to the opening <html> tag! (And yes...the page tags have been removed!! 
> ;-) )
> 
> What attribute in the sitemap xhtml serialize definition do I need to 
> tweak to ensure that the opening html tag is populated with the w3 xhtml 
> declaration?

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

IIRC the former is just the XML serializer with a custom mime-type, so 
it doesn't do anything special like adding the xmlns declaration or 
preventing collapsing of <script/> tags.  To get that you'll need to use 
the latter.



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


Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Hi,
I have also realized that the:

xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" is not being written to
the opening <html> tag! (And yes...the page tags have been removed!! ;-) )

What attribute in the sitemap xhtml serialize definition do I need to tweak
to ensure that the opening html tag is populated with the w3 xhtml
declaration?

--
Regards

Andrew
On 04/03/07, Andrew Madu <an...@gmail.com> wrote:
>
> Hi,
> can anyone else who is using cforms/ajax form validation change the
> serialize type to xhtml instead of html in the ajax-request sitemap section
> and confirm with me what happens when you try to submit your form?
>
> What I am witnessing is a complete page reload which is not meant to
> happen and does not happen when the serialize type is html.
>
> This, as I have mentioned back in 26/07/2006 is still a bug and simply
> loading your form page when serialize='xhtml' will generate the following
> javascript error:
>
> 'cocoon' does not exist
>
> I am using Win XP/SP2 with Java 1.6 and running cocoon 2.1.10(SVN
> Snapshot)
>
> --
> Regards
>
> Andrew
>
> On 02/03/07, Andrew Madu <an...@gmail.com> wrote:
> >
> > Hi Grzegorz,
> >
> >
> > > Unfortunately not. I've tried to reproduce your problems two times and
> > >
> > > with no success so cannot help here. If you really like to solve this
> > > issue I can only suggest one thing that can others help to figure out
> > > your problem. Try to change forms samples to show the same behavior
> > > and
> > > provide a patch with your changes so we can be sure that we work on
> > > exactly the same code and in the same conditions.
> >
> >
> >
> > Would it be possible for you to send me the xslt file you were working
> > on? If it works your end it should work here as well..then I will take
> > things from there.
> >
> > --
> > Regards
> >
> > Andrew
> >
> >
> >
>

Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Hi,
can anyone else who is using cforms/ajax form validation change the
serialize type to xhtml instead of html in the ajax-request sitemap section
and confirm with me what happens when you try to submit your form?

What I am witnessing is a complete page reload which is not meant to happen
and does not happen when the serialize type is html.

This, as I have mentioned back in 26/07/2006 is still a bug and simply
loading your form page when serialize='xhtml' will generate the following
javascript error:

'cocoon' does not exist

I am using Win XP/SP2 with Java 1.6 and running cocoon 2.1.10(SVN Snapshot)

--
Regards

Andrew

On 02/03/07, Andrew Madu <an...@gmail.com> wrote:
>
> Hi Grzegorz,
>
>
> > Unfortunately not. I've tried to reproduce your problems two times and
> > with no success so cannot help here. If you really like to solve this
> > issue I can only suggest one thing that can others help to figure out
> > your problem. Try to change forms samples to show the same behavior and
> > provide a patch with your changes so we can be sure that we work on
> > exactly the same code and in the same conditions.
>
>
>
> Would it be possible for you to send me the xslt file you were working on?
> If it works your end it should work here as well..then I will take things
> from there.
>
> --
> Regards
>
> Andrew
>
>
>

Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Hi Grzegorz,


> Unfortunately not. I've tried to reproduce your problems two times and
> with no success so cannot help here. If you really like to solve this
> issue I can only suggest one thing that can others help to figure out
> your problem. Try to change forms samples to show the same behavior and
> provide a patch with your changes so we can be sure that we work on
> exactly the same code and in the same conditions.



Would it be possible for you to send me the xslt file you were working on?
If it works your end it should work here as well..then I will take things
from there.

--
Regards

Andrew

Re: Xhtml and Ajax...no go!!

Posted by Grzegorz Kossakowski <gr...@tuffmail.com>.
Andrew Madu napisał(a):
> Ah yes...this the chap I was looking for!!
>
> Since I first put this question to the list the formatting issues have 
> all been resolved. What has not been resolved is the usage of xhtml as 
> opposed to html in the ajax-request section:
>
> 				<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>
>
> which gives the dreaded 
>
> '
> cocoon is not defined dojo_ajax.js (line 1)'
>
> Any ideas as to why declaring the serialize type as xhtml would cause this? I have attached the rendered xhtml page as xml.
>
Unfortunately not. I've tried to reproduce your problems two times and 
with no success so cannot help here. If you really like to solve this 
issue I can only suggest one thing that can others help to figure out 
your problem. Try to change forms samples to show the same behavior and 
provide a patch with your changes so we can be sure that we work on 
exactly the same code and in the same conditions.

I'm aware that asking for this is not what you would like to see, but 
there is no way now to help you, really.

-- 
Grzegorz Kossakowski

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


Re: Xhtml and Ajax...no go!!

Posted by Andrew Madu <an...@gmail.com>.
Ah yes...this the chap I was looking for!!

Since I first put this question to the list the formatting issues have all
been resolved. What has not been resolved is the usage of xhtml as opposed
to html in the ajax-request section:

				<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>

which gives the dreaded

'cocoon is not defined dojo_ajax.js (line 1)'

Any ideas as to why declaring the serialize type as xhtml would cause
this? I have attached the rendered xhtml page as xml.

--
Regards

Andrew



On 09/08/06, Andrew <an...@gmail.com> wrote:
>
> Hi Antonio,
> a thought! As you know your xhtml serializer is working could you please
> post me all of your assciated web-inf/lib serializer-block/charset jars. If
> that doesn't work then I will know that something else is causing the
> problem.
>
> regards
>
> Andrew
>
> On 09/08/06, Andrew <an...@gmail.com> wrote:
> >
> > Hi Antonio,
> > I tried the branch and that made no difference and my classpath is fine,
> > so I am completely stuck with this one.
> >
> > regards
> >
> > Andrew
> >
> >
> > On 08/08/06, Antonio Gallardo <ag...@agssa.net> wrote:
> > >
> > > Hi Andrew,
> > >
> > > Would you try the 2.1.-x branch? Few weeks ago we did test with the
> > > xhtml serializer and it worked nicely. Maybe you should also check
> > > your
> > > classpath?
> > >
> > > Best Regards,
> > >
> > > Antonio Gallardo.
> > >
> > > Andrew escribió:
> > > > Hi Antonio,
> > > > no that is not the problem unfortunately, as my
> > > > local.blocks.properties setting for serializers is definately set as
> > > so:
> > > >
> > > > include.block.serializers=true
> > > >
> > > > and the cocoon-serializers-block.jar is most definately in my
> > > > WEB-INF/lib folder, so the problem lays elsewhere! Any ideas anyone?
> > > >
> > > > regards
> > > >
> > > > Andrew
> > > >
> > > > On 08/08/06, *Antonio Gallardo* < agallardo@agssa.net
> > > > <mailto: agallardo@agssa.net>> wrote:
> > > >
> > > >     Hi Andrew,
> > > >
> > > >     Seems like you are missing the serializers block. Try to add
> > > this
> > > >     block
> > > >     in your build, rebuild cocoon and the message should not show
> > > >     anymore. :-)
> > > >
> > > >     Best Regards,
> > > >
> > > >     Antonio Gallardo.
> > > >
> > > >     Andrew escribió:
> > > >     > Hi,
> > > >     > in fact I just tried the 'exhtml' serializer and got the
> > > following
> > > >     > error (snippet):
> > > >     >
> > > >     > java.lang.NoClassDefFoundError
> > > >     >
> > > >
> > > org.apache.cocoon.components.serializers.EncodingSerializer.configure
> > > >     > (EncodingSerializer.java:167)
> > > >     >
> > > >
> > > org.apache.cocoon.components.serializers.XHTMLSerializer.configure (
> > > XHTMLSerializer.java:114)
> > > >     >
> > > >     org.apache.avalon.framework.container.ContainerUtil.configure
> > > >     (ContainerUtil.java:201)
> > > >     >
> > > >     >
> > > >     >
> > > >     > Joy of joys!! This should be part of the standard build for
> > > >     2.1.9 right!?!
> > > >     >
> > > >     > regards
> > > >     >
> > > >     > Andrew
> > > >
> > > >
> > > >
> > > ---------------------------------------------------------------------
> > > >     To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > > >     <mailto: users-unsubscribe@cocoon.apache.org>
> > > >     For additional commands, e-mail: users-help@cocoon.apache.org
> > > >     <mailto: users-help@cocoon.apache.org>
> > > >
> > > >
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > > For additional commands, e-mail: users-help@cocoon.apache.org
> > >
> > >
> >
>

Re: Xhtml and Ajax...no go!!

Posted by Andrew <an...@gmail.com>.
Hi Antonio,
a thought! As you know your xhtml serializer is working could you please
post me all of your assciated web-inf/lib serializer-block/charset jars. If
that doesn't work then I will know that something else is causing the
problem.

regards

Andrew

On 09/08/06, Andrew <an...@gmail.com> wrote:
>
> Hi Antonio,
> I tried the branch and that made no difference and my classpath is fine,
> so I am completely stuck with this one.
>
> regards
>
> Andrew
>
>
> On 08/08/06, Antonio Gallardo <ag...@agssa.net> wrote:
> >
> > Hi Andrew,
> >
> > Would you try the 2.1.-x branch? Few weeks ago we did test with the
> > xhtml serializer and it worked nicely. Maybe you should also check your
> > classpath?
> >
> > Best Regards,
> >
> > Antonio Gallardo.
> >
> > Andrew escribió:
> > > Hi Antonio,
> > > no that is not the problem unfortunately, as my
> > > local.blocks.properties setting for serializers is definately set as
> > so:
> > >
> > > include.block.serializers=true
> > >
> > > and the cocoon-serializers-block.jar is most definately in my
> > > WEB-INF/lib folder, so the problem lays elsewhere! Any ideas anyone?
> > >
> > > regards
> > >
> > > Andrew
> > >
> > > On 08/08/06, *Antonio Gallardo* < agallardo@agssa.net
> > > <ma...@agssa.net>> wrote:
> > >
> > >     Hi Andrew,
> > >
> > >     Seems like you are missing the serializers block. Try to add this
> > >     block
> > >     in your build, rebuild cocoon and the message should not show
> > >     anymore. :-)
> > >
> > >     Best Regards,
> > >
> > >     Antonio Gallardo.
> > >
> > >     Andrew escribió:
> > >     > Hi,
> > >     > in fact I just tried the 'exhtml' serializer and got the
> > following
> > >     > error (snippet):
> > >     >
> > >     > java.lang.NoClassDefFoundError
> > >     >
> > >
> > org.apache.cocoon.components.serializers.EncodingSerializer.configure
> > >     > (EncodingSerializer.java:167)
> > >     >
> > >     org.apache.cocoon.components.serializers.XHTMLSerializer.configure(
> > XHTMLSerializer.java:114)
> > >     >
> > >     org.apache.avalon.framework.container.ContainerUtil.configure
> > >     (ContainerUtil.java:201)
> > >     >
> > >     >
> > >     >
> > >     > Joy of joys!! This should be part of the standard build for
> > >     2.1.9 right!?!
> > >     >
> > >     > regards
> > >     >
> > >     > Andrew
> > >
> > >
> > >
> > ---------------------------------------------------------------------
> > >     To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > >     <ma...@cocoon.apache.org>
> > >     For additional commands, e-mail: users-help@cocoon.apache.org
> > >     <ma...@cocoon.apache.org>
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>

Re: Xhtml and Ajax...no go!!

Posted by Andrew <an...@gmail.com>.
Hi Antonio,
I tried the branch and that made no difference and my classpath is fine, so
I am completely stuck with this one.

regards

Andrew

On 08/08/06, Antonio Gallardo <ag...@agssa.net> wrote:
>
> Hi Andrew,
>
> Would you try the 2.1.-x branch? Few weeks ago we did test with the
> xhtml serializer and it worked nicely. Maybe you should also check your
> classpath?
>
> Best Regards,
>
> Antonio Gallardo.
>
> Andrew escribió:
> > Hi Antonio,
> > no that is not the problem unfortunately, as my
> > local.blocks.properties setting for serializers is definately set as so:
> >
> > include.block.serializers=true
> >
> > and the cocoon-serializers-block.jar is most definately in my
> > WEB-INF/lib folder, so the problem lays elsewhere! Any ideas anyone?
> >
> > regards
> >
> > Andrew
> >
> > On 08/08/06, *Antonio Gallardo* <agallardo@agssa.net
> > <ma...@agssa.net>> wrote:
> >
> >     Hi Andrew,
> >
> >     Seems like you are missing the serializers block. Try to add this
> >     block
> >     in your build, rebuild cocoon and the message should not show
> >     anymore. :-)
> >
> >     Best Regards,
> >
> >     Antonio Gallardo.
> >
> >     Andrew escribió:
> >     > Hi,
> >     > in fact I just tried the 'exhtml' serializer and got the following
> >     > error (snippet):
> >     >
> >     > java.lang.NoClassDefFoundError
> >     >
> >
> org.apache.cocoon.components.serializers.EncodingSerializer.configure
> >     > (EncodingSerializer.java:167)
> >     >
> >     org.apache.cocoon.components.serializers.XHTMLSerializer.configure(
> XHTMLSerializer.java:114)
> >     >
> >     org.apache.avalon.framework.container.ContainerUtil.configure
> >     (ContainerUtil.java:201)
> >     >
> >     >
> >     >
> >     > Joy of joys!! This should be part of the standard build for
> >     2.1.9 right!?!
> >     >
> >     > regards
> >     >
> >     > Andrew
> >
> >
> >
> ---------------------------------------------------------------------
> >     To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> >     <ma...@cocoon.apache.org>
> >     For additional commands, e-mail: users-help@cocoon.apache.org
> >     <ma...@cocoon.apache.org>
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Xhtml and Ajax...no go!!

Posted by Antonio Gallardo <ag...@agssa.net>.
Hi Andrew,

Would you try the 2.1.-x branch? Few weeks ago we did test with the 
xhtml serializer and it worked nicely. Maybe you should also check your 
classpath?

Best Regards,

Antonio Gallardo.

Andrew escribió:
> Hi Antonio,
> no that is not the problem unfortunately, as my 
> local.blocks.properties setting for serializers is definately set as so:
>
> include.block.serializers=true
>
> and the cocoon-serializers-block.jar is most definately in my 
> WEB-INF/lib folder, so the problem lays elsewhere! Any ideas anyone?
>
> regards
>
> Andrew
>
> On 08/08/06, *Antonio Gallardo* <agallardo@agssa.net 
> <ma...@agssa.net>> wrote:
>
>     Hi Andrew,
>
>     Seems like you are missing the serializers block. Try to add this
>     block
>     in your build, rebuild cocoon and the message should not show
>     anymore. :-)
>
>     Best Regards,
>
>     Antonio Gallardo.
>
>     Andrew escribió:
>     > Hi,
>     > in fact I just tried the 'exhtml' serializer and got the following
>     > error (snippet):
>     >
>     > java.lang.NoClassDefFoundError
>     >      
>     org.apache.cocoon.components.serializers.EncodingSerializer.configure
>     > (EncodingSerializer.java:167)
>     >      
>     org.apache.cocoon.components.serializers.XHTMLSerializer.configure(XHTMLSerializer.java:114)
>     >      
>     org.apache.avalon.framework.container.ContainerUtil.configure
>     (ContainerUtil.java:201)
>     >
>     >
>     >
>     > Joy of joys!! This should be part of the standard build for
>     2.1.9 right!?!
>     >
>     > regards
>     >
>     > Andrew
>
>
>     ---------------------------------------------------------------------
>     To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
>     <ma...@cocoon.apache.org>
>     For additional commands, e-mail: users-help@cocoon.apache.org
>     <ma...@cocoon.apache.org>
>
>


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


Re: Xhtml and Ajax...no go!!

Posted by Andrew <an...@gmail.com>.
Hi Antonio,
no that is not the problem unfortunately, as my
local.blocks.propertiessetting for serializers is definately set as
so:

include.block.serializers=true

and the cocoon-serializers-block.jar is most definately in my WEB-INF/lib
folder, so the problem lays elsewhere! Any ideas anyone?

regards

Andrew

On 08/08/06, Antonio Gallardo <ag...@agssa.net> wrote:
>
> Hi Andrew,
>
> Seems like you are missing the serializers block. Try to add this block
> in your build, rebuild cocoon and the message should not show anymore. :-)
>
> Best Regards,
>
> Antonio Gallardo.
>
> Andrew escribió:
> > Hi,
> > in fact I just tried the 'exhtml' serializer and got the following
> > error (snippet):
> >
> > java.lang.NoClassDefFoundError
> >
> org.apache.cocoon.components.serializers.EncodingSerializer.configure
> > (EncodingSerializer.java:167)
> >       org.apache.cocoon.components.serializers.XHTMLSerializer.configure
> (XHTMLSerializer.java:114)
> >       org.apache.avalon.framework.container.ContainerUtil.configure(
> ContainerUtil.java:201)
> >
> >
> >
> > Joy of joys!! This should be part of the standard build for 2.1.9right!?!
> >
> > regards
> >
> > Andrew
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Xhtml and Ajax...no go!!

Posted by Antonio Gallardo <ag...@agssa.net>.
Hi Andrew,

Seems like you are missing the serializers block. Try to add this block 
in your build, rebuild cocoon and the message should not show anymore. :-)

Best Regards,

Antonio Gallardo.

Andrew escribió:
> Hi,
> in fact I just tried the 'exhtml' serializer and got the following 
> error (snippet):
>
> java.lang.NoClassDefFoundError
> 	org.apache.cocoon.components.serializers.EncodingSerializer.configure
> (EncodingSerializer.java:167)
> 	org.apache.cocoon.components.serializers.XHTMLSerializer.configure(XHTMLSerializer.java:114)
> 	org.apache.avalon.framework.container.ContainerUtil.configure(ContainerUtil.java:201)
>
>
>
> Joy of joys!! This should be part of the standard build for 2.1.9 right!?!
>
> regards
>
> Andrew


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


Re: Xhtml and Ajax...no go!!

Posted by Andrew <an...@gmail.com>.
Hi,
in fact I just tried the 'exhtml' serializer and got the following error
(snippet):

java.lang.NoClassDefFoundError
	org.apache.cocoon.components.serializers.EncodingSerializer.configure(EncodingSerializer.java:167)
	org.apache.cocoon.components.serializers.XHTMLSerializer.configure(XHTMLSerializer.java:114)
	org.apache.avalon.framework.container.ContainerUtil.configure(ContainerUtil.java:201)


Joy of joys!! This should be part of the standard build for 2.1.9 right!?!

regards

Andrew



On 28/07/06, Andrew <an...@gmail.com> wrote:
>
> Jason,
> again, you are the man!! I will await your final bug fixes.
>
> regards
>
> Andrew
>
>
> On 28/07/06, Jason Johnston < cocoon@lojjic.net> wrote:
> >
> > Andrew wrote:
> > > Hi,
> > > can someone please tell me why when setting ajax="true" in my CForm
> > and
> > > serializing the document as xhtml (Strict) the following line in the
> > > xhtml output should break the page?:
> >
> > Which xhtml serializer are you using?  The default one configured in the
> > main sitemap distributed with Cocoon (which is just the XMLSerializer
> > with a special doctype configured), or the XHTMLSeralizer from the
> > serializers block?  I'm guessing the former.
> >
> > Remember that just adding an XHTML doctype to a HTML document does not
> > make it XHTML.  It also has to be well-formed XML, and be in the
> > http://www.w3.org/1999/xhtml namespace.  My hunch is that your content,
> > though well-formed, is not in the XHTML namespace, so the browser does
> > not recognize those elements as HTML and therefore does not apply the
> > default styles that are normally applied to HTML.  This is why the page
> > layout "breaks" as you say.
> >
> > Getting your CForms content into the XHTML namespace is a little tricky
> > since the forms-*-styling.xsl transforms produce output in the null
> > namespace.  So you need something that changes that output into the
> > XHTML namespace.
> >
> > There are two options I know of for this:
> >
> > 1) Add a transform before the serializer that changes the namespace of
> > all elements... could be something as simple as a single template:
> >
> > <xsl:template match="*">
> >    <xsl:element name="{local-name()}"
> > namespace=" http://www.w3.org/1999/xhtml">
> >      <xsl:copy-of select="@*" />
> >      <xsl:apply-templates />
> >    </xsl:element>
> > </xsl:template>
> >
> > 2) Use the XHTMLSerializer from the serializers block.  This serializer
> > adds the XHTML namespace to un-namespaced elements automatically.  In
> > addition it also does other XHTML-specific things like making sure
> > <script></script> tags are not collapsed, so I would recommend this
> > approach.
> >
> > Once you've got that working, you will need to be aware that changing to
> > a strict XHTML doctype will trigger strict mode in certain browsers, so
> > you will need to be much more careful about other things as well, such
> > as the mime-types of supporting CSS files and differences in the DOM for
> > scripts.  In fact I'm not sure if the Dojo/AJAX code even takes those
> > DOM differences into account.
> >
> > Also, and this is a pet peeve of mine: the CForms AJAX framework
> > currently does not produce valid HTML/XHTML, in that there are some
> > custom attributes used to support the AJAX code (dojoType="CFormsForm"
> > on <form> in particular) which will prevent the document from
> > validating.  Which begs the question: why are you trying to produce
> > XHTML in the first place?  If it's an attempt to enforce some sort of
> > stricter document validation then you're going to have trouble.
> >
> > ...
> >
> > OK, so I just gave it a quick try, using the XHTML serializer from the
> > serializers block.  The page style/layout is fixed, but it turns out
> > those DOM differences I mentioned earlier are indeed causing problems in
> >
> > the CForms/Dojo client-side Javascript code.  I'll be submitting a patch
> > soon for some of them, hopefully I can fix them all.  But in the
> > meantime, you need to know that it won't work out of the box.  Sorry!
> >
> > --Jason
> >
> >
> >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>

Re: Xhtml and Ajax...no go!!

Posted by Andrew <an...@gmail.com>.
Jason,
again, you are the man!! I will await your final bug fixes.

regards

Andrew

On 28/07/06, Jason Johnston <co...@lojjic.net> wrote:
>
> Andrew wrote:
> > Hi,
> > can someone please tell me why when setting ajax="true" in my CForm and
> > serializing the document as xhtml (Strict) the following line in the
> > xhtml output should break the page?:
>
> Which xhtml serializer are you using?  The default one configured in the
> main sitemap distributed with Cocoon (which is just the XMLSerializer
> with a special doctype configured), or the XHTMLSeralizer from the
> serializers block?  I'm guessing the former.
>
> Remember that just adding an XHTML doctype to a HTML document does not
> make it XHTML.  It also has to be well-formed XML, and be in the
> http://www.w3.org/1999/xhtml namespace.  My hunch is that your content,
> though well-formed, is not in the XHTML namespace, so the browser does
> not recognize those elements as HTML and therefore does not apply the
> default styles that are normally applied to HTML.  This is why the page
> layout "breaks" as you say.
>
> Getting your CForms content into the XHTML namespace is a little tricky
> since the forms-*-styling.xsl transforms produce output in the null
> namespace.  So you need something that changes that output into the
> XHTML namespace.
>
> There are two options I know of for this:
>
> 1) Add a transform before the serializer that changes the namespace of
> all elements... could be something as simple as a single template:
>
> <xsl:template match="*">
>    <xsl:element name="{local-name()}"
> namespace="http://www.w3.org/1999/xhtml">
>      <xsl:copy-of select="@*" />
>      <xsl:apply-templates />
>    </xsl:element>
> </xsl:template>
>
> 2) Use the XHTMLSerializer from the serializers block.  This serializer
> adds the XHTML namespace to un-namespaced elements automatically.  In
> addition it also does other XHTML-specific things like making sure
> <script></script> tags are not collapsed, so I would recommend this
> approach.
>
> Once you've got that working, you will need to be aware that changing to
> a strict XHTML doctype will trigger strict mode in certain browsers, so
> you will need to be much more careful about other things as well, such
> as the mime-types of supporting CSS files and differences in the DOM for
> scripts.  In fact I'm not sure if the Dojo/AJAX code even takes those
> DOM differences into account.
>
> Also, and this is a pet peeve of mine: the CForms AJAX framework
> currently does not produce valid HTML/XHTML, in that there are some
> custom attributes used to support the AJAX code (dojoType="CFormsForm"
> on <form> in particular) which will prevent the document from
> validating.  Which begs the question: why are you trying to produce
> XHTML in the first place?  If it's an attempt to enforce some sort of
> stricter document validation then you're going to have trouble.
>
> ...
>
> OK, so I just gave it a quick try, using the XHTML serializer from the
> serializers block.  The page style/layout is fixed, but it turns out
> those DOM differences I mentioned earlier are indeed causing problems in
> the CForms/Dojo client-side Javascript code.  I'll be submitting a patch
> soon for some of them, hopefully I can fix them all.  But in the
> meantime, you need to know that it won't work out of the box.  Sorry!
>
> --Jason
>
>
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Xhtml and Ajax...no go!!

Posted by Jason Johnston <co...@lojjic.net>.
Andrew wrote:
> Hi,
> can someone please tell me why when setting ajax="true" in my CForm and 
> serializing the document as xhtml (Strict) the following line in the 
> xhtml output should break the page?:

Which xhtml serializer are you using?  The default one configured in the 
main sitemap distributed with Cocoon (which is just the XMLSerializer 
with a special doctype configured), or the XHTMLSeralizer from the 
serializers block?  I'm guessing the former.

Remember that just adding an XHTML doctype to a HTML document does not 
make it XHTML.  It also has to be well-formed XML, and be in the 
http://www.w3.org/1999/xhtml namespace.  My hunch is that your content, 
though well-formed, is not in the XHTML namespace, so the browser does 
not recognize those elements as HTML and therefore does not apply the 
default styles that are normally applied to HTML.  This is why the page 
layout "breaks" as you say.

Getting your CForms content into the XHTML namespace is a little tricky 
since the forms-*-styling.xsl transforms produce output in the null 
namespace.  So you need something that changes that output into the 
XHTML namespace.

There are two options I know of for this:

1) Add a transform before the serializer that changes the namespace of 
all elements... could be something as simple as a single template:

<xsl:template match="*">
   <xsl:element name="{local-name()}" 
namespace="http://www.w3.org/1999/xhtml">
     <xsl:copy-of select="@*" />
     <xsl:apply-templates />
   </xsl:element>
</xsl:template>

2) Use the XHTMLSerializer from the serializers block.  This serializer 
adds the XHTML namespace to un-namespaced elements automatically.  In 
addition it also does other XHTML-specific things like making sure 
<script></script> tags are not collapsed, so I would recommend this 
approach.

Once you've got that working, you will need to be aware that changing to 
a strict XHTML doctype will trigger strict mode in certain browsers, so 
you will need to be much more careful about other things as well, such 
as the mime-types of supporting CSS files and differences in the DOM for 
scripts.  In fact I'm not sure if the Dojo/AJAX code even takes those 
DOM differences into account.

Also, and this is a pet peeve of mine: the CForms AJAX framework 
currently does not produce valid HTML/XHTML, in that there are some 
custom attributes used to support the AJAX code (dojoType="CFormsForm" 
on <form> in particular) which will prevent the document from 
validating.  Which begs the question: why are you trying to produce 
XHTML in the first place?  If it's an attempt to enforce some sort of 
stricter document validation then you're going to have trouble.

...

OK, so I just gave it a quick try, using the XHTML serializer from the 
serializers block.  The page style/layout is fixed, but it turns out 
those DOM differences I mentioned earlier are indeed causing problems in 
the CForms/Dojo client-side Javascript code.  I'll be submitting a patch 
soon for some of them, hopefully I can fix them all.  But in the 
meantime, you need to know that it won't work out of the box.  Sorry!

--Jason





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


Re: Xhtml and Ajax...no go!!

Posted by Andrew <an...@gmail.com>.
Mark,

> 3. Page breaks!!


what that means is that your well formed, under html serialization,  page is
now not well formed. The page is all over the place, as if you have missed
out a few TR/TD tags on a table. Like I said before, try it..you will see
what I and Marco (321los@gmail.com) mean. If fact read Marcos post.

regards

Andrew

Re: Xhtml and Ajax...no go!!

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Jul 27, 2006, at 1:28 PM, Andrew wrote:

> 3. Page breaks!!

"Page breaks", what the heck does that mean?!
—ml—


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


Re: Xhtml and Ajax...no go!!

Posted by Andrew <an...@gmail.com>.
Hi Mark,
the problemo is this:

1. You are all set up for ajax
2. Your page loads through your pipe with following:

				<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>

Notice that serialize type="xhtml".

3. Page breaks!!
4. Problem is caused by the javascript code immediately following the
<form> tag:
<script>cocoon.form.ajax = true;</script>
5. If you change script after form tag to read <script src="" /> where
your src is the one line of javascript,
you get an error message saying 'cocoon undefined'.
6. Switch serialize type back to type="html" and page loads ok using
either inline or include script tags!

Try it and see...Any ideas for this one would be great!!

regards

Andrew




On 27/07/06, Mark Lundquist <ml...@wrinkledog.com> wrote:
>
>
> On Jul 27, 2006, at 9:20 AM, Andrew wrote:
>
> > But it is not the pipe which is causing the problem, it is the
> > javascript syntax directly after the initial form tag in the xhtml
> > page.
>
> So, what _is_ the actual problem here?... Going back to the first post,
> it just says that it "breaks the page"... sorry if I'm missing
> something.. ;)
> —ml—
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

Re: Xhtml and Ajax...no go!!

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Jul 27, 2006, at 9:20 AM, Andrew wrote:

> But it is not the pipe which is causing the problem, it is the 
> javascript syntax directly after the initial form tag in the xhtml 
> page.

So, what _is_ the actual problem here?... Going back to the first post, 
it just says that it "breaks the page"... sorry if I'm missing 
something.. ;)
—ml—


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


Re: Xhtml and Ajax...no go!!

Posted by Andrew <an...@gmail.com>.
Ah HAH!! So i'm not imagining things, this is a problem!!!!


Did you undestand this part of the pipeline?
>
> <map:select type="ajax-request">
>                   <map:when test="true">
>                     <map:serialize type="xml"/>
>                   </map:when>
>                   <map:otherwise>
>                     <map:serialize type="html"/>
>                   </map:otherwise>
>

In a word yes. The link below will give you a proper understanding of what
is going on here:

http://66.249.93.104/search?q=cache:TXOJgvCDOg4J:cocoongt.hippo12.castaserver.com/cocoongt/sylvain-wallez-AjaxInCocoon.pdf+ajax+in+cocoon&hl=en&gl=uk&ct=clnk&cd=3&client=firefox-a

But it is not the pipe which is causing the problem, it is the javascript
syntax directly after the initial form tag in the xhtml page. If you change
that code to <script src="" ></script>, where the script page has the one
line of code cocoo.ajax.form=true; then the page loads correctly, all be it
with a javscript error saying that cocoon is undefined. This same code mind,
serialized as html, loads poroperly and with no javascript error!!! What is
going on here??????

regards

Andrew

Re: Xhtml and Ajax...no go!!

Posted by 32...@gmail.com.
Hi Andrew,
I use 2.1.9 as well and no, when switching to xhtml, it does not load
correctly. It omits my complete css styling (stored in a seperate file),
displays just a white page with my three dropdown boxes. Those are supposed
to be there btw. (I use a modification of the carselector sample)

Did you undestand this part of the pipeline?
<map:select type="ajax-request">
                  <map:when test="true">
                    <map:serialize type="xml"/>
                  </map:when>
                  <map:otherwise>
                    <map:serialize type="html"/>
                  </map:otherwise>
If yes, could you please tell me what it does (without distracting from your
problem)?
Thanks
Marco


2006/7/27, Andrew <an...@gmail.com>:
>
> Hi,
> i'm using Cocoon 2.1.9 by the way.
>
>
> regards
>
> Andrew
>
> On 27/07/06, Andrew <andrewmadu@gmail.com > wrote:
> >
> > Hi,
> > for those of you guys using Ajax could you do me a big favour please. In
> > your ajax pipe:
> >
> >
> >                 <map:select type="ajax-request">
> >                   <map:when test="true">
> >                     <map:serialize type="xml"/>
> >                   </map:when>
> >                   <map:otherwise>
> >                     <map:serialize type="html"/>
> >                   </map:otherwise>
> >
> > could you please change the serialize type="html" to type="xhtml" and
> > tell me whether your page loads correctly afterwards?
> >
> > regards
> >
> > Andrew
> >
> >
> > On 27/07/06, Andrew <andrewmadu@gmail.com > wrote:
> > >
> > > Mark,
> > > thansk for the heads up, much appreciated.
> > >
> > > BTW I think you have now officially taken over from me the distinction
> > > >
> > > > of Most Replies To Own Posts :-)...
> > >
> > >
> > > Hoooray!!!!! ;-)
> > >
> > >
> > > keep the faith, man!
> > >
> > >
> > > I always do...ask and you shall receive, seek and you shall find ;-)
> > >
> > > regards
> > >
> > > Andrew
> > >
> > >
> > >
> > >
> >
>

Re: Xhtml and Ajax...no go!!

Posted by Andrew <an...@gmail.com>.
Hi,
i'm using Cocoon 2.1.9 by the way.

regards

Andrew

On 27/07/06, Andrew <an...@gmail.com> wrote:
>
> Hi,
> for those of you guys using Ajax could you do me a big favour please. In
> your ajax pipe:
>
>
>                 <map:select type="ajax-request">
>                   <map:when test="true">
>                     <map:serialize type="xml"/>
>                   </map:when>
>                   <map:otherwise>
>                     <map:serialize type="html"/>
>                   </map:otherwise>
>
> could you please change the serialize type="html" to type="xhtml" and tell
> me whether your page loads correctly afterwards?
>
> regards
>
> Andrew
>
>
> On 27/07/06, Andrew <an...@gmail.com> wrote:
> >
> > Mark,
> > thansk for the heads up, much appreciated.
> >
> > BTW I think you have now officially taken over from me the distinction
> > > of Most Replies To Own Posts :-)...
> >
> >
> > Hoooray!!!!! ;-)
> >
> >
> > keep the faith, man!
> >
> >
> > I always do...ask and you shall receive, seek and you shall find ;-)
> >
> > regards
> >
> > Andrew
> >
> >
> >
> >
>

Re: Xhtml and Ajax...no go!!

Posted by Andrew <an...@gmail.com>.
Hi,
for those of you guys using Ajax could you do me a big favour please. In
your ajax pipe:

                <map:select type="ajax-request">
                  <map:when test="true">
                    <map:serialize type="xml"/>
                  </map:when>
                  <map:otherwise>
                    <map:serialize type="html"/>
                  </map:otherwise>

could you please change the serialize type="html" to type="xhtml" and tell
me whether your page loads correctly afterwards?

regards

Andrew

On 27/07/06, Andrew <an...@gmail.com> wrote:
>
> Mark,
> thansk for the heads up, much appreciated.
>
> BTW I think you have now officially taken over from me the distinction
> > of Most Replies To Own Posts :-)...
>
>
> Hoooray!!!!! ;-)
>
>
> keep the faith, man!
>
>
> I always do...ask and you shall receive, seek and you shall find ;-)
>
> regards
>
> Andrew
>
>
>
>

Re: Xhtml and Ajax...no go!!

Posted by Andrew <an...@gmail.com>.
Mark,
thansk for the heads up, much appreciated.

BTW I think you have now officially taken over from me the distinction
> of Most Replies To Own Posts :-)...


Hoooray!!!!! ;-)


keep the faith, man!


I always do...ask and you shall receive, seek and you shall find ;-)

regards

Andrew

Re: Xhtml and Ajax...no go!!

Posted by Mark Lundquist <ml...@wrinkledog.com>.
On Jul 26, 2006, at 3:53 AM, Andrew wrote:

> from where do I get rid of it from? I removed the declaration from my 
> xsl stylesheet, but still it remains.

You gots ta have the XML declaration in your stylesheet, otherwise the 
XSLT transformer can't parse it...

> I checked the map:serializer section of the sitemap and there is 
> nothing there either.

As you correctly presumed, the XML declaration in the output stream 
comes from the serializer, not from the stylesheet.  I think you want 
this element in your <serializer>:

	<omit-xml-declaration>yes<omit-xml-declaration>

Give that a shot :-)

BTW I think you have now officially taken over from me the distinction 
of Most Replies To Own Posts :-)... keep the faith, man!

cheers,
—ml—


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


Re: Xhtml and Ajax...no go!!

Posted by Andrew <an...@gmail.com>.
Hi,
I got the following information from the wikipedia (
http://en.wikipedia.org/wiki/XHTML)


The following is an example of XHTML 1.0 Strict.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
 <head>
  <title>XHTML 1.0 Example</title>
  <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
 </head>
 <body>
  <p>This is a tiny example of an <abbr title="Extensible HyperText
Markup Language">XHTML</abbr> 1.0 Strict document. Note that either
  the XML declaration or the meta tag is necessary, but not both.</p>
 </body>
</html>

regards

Andre

On 26/07/06, Andrew <an...@gmail.com> wrote:
>
> Hi,
> in fact the document will not even load without the xml declaration in the
> page. If you remove it you get the following error message:
>
> Invalid byte 1 of 1-byte UTF-8 sequence.
>
> regards
>
> Andrew
>
>
> On 26/07/06, Andrew <an...@gmail.com> wrote:
> >
> > Philip,
> > from where do I get rid of it from? I removed the declaration from my
> > xsl stylesheet, but still it remains. I checked the map:serializer section
> > of the sitemap and there is nothing there either. I thought I might have a
> > caching issue on my server so I restarted it, still no go.
> >
> > regards
> >
> > Andrew
> >
> >
> > On 26/07/06, Fennell, Philip < philip.fennell@hp.com> wrote:
> > >
> > > Andrew,
> > >
> > > Although I cannot comment on your stated problem I was drawn to reply
> > > because I noticed that your example XHTML output had an XML
> > > declaration
> > > at the start:
> > >
> > > <?xml version="1.0" encoding="ISO-8859-1"?>
> > >
> > > If you want the web pages you are generating to render as best as
> > > possible across all browsers then you need to drop the XML
> > > declaration.
> > > Internet Explorer 6 will not run in standards compliance mode, even
> > > with
> > > the correct DOCTYPE declaration, if the XML declaration is there too.
> > >
> > >
> > >
> > > Regards
> > >
> > > Philip Fennell
> > >
> > >
> > >
> > >
> > >
> > > ________________________________
> > >
> > > From: Andrew [mailto: andrewmadu@gmail.com]
> > > Sent: 26 July 2006 09:21
> > > To: users@cocoon.apache.org
> > > Subject: Xhtml and Ajax...no go!!
> > >
> > >
> > > Hi,
> > > can someone please tell me why when setting ajax="true" in my CForm
> > > and
> > > serializing the document as xhtml (Strict) the following line in the
> > > xhtml output should break the page?:
> > >
> > >
> > > <?xml version="1.0" encoding="ISO-8859-1"?>
> > > <!DOCTYPE page PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
> > > http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
> > > < http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd > ">
> > > .........
> > >
> > > <form action
> > > ="updateAccounts.kont" ajax="true" name=
> > > "Form1" method="POST" dojoType="CFormsForm"
> > > >
> > > <script type=
> > > "text/javascript">cocoon.forms.ajax = true;</script
> > > >
> > >
> > > What is it about the script line that xhtml does not like? My ajax map
> > > is:
> > >
> > >                                 <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>
> > >
> > >
> > > If I change the forms-styling-*.xsl document to an indclude js file.
> > > <script src="" />, which contains that one line of js,
> > > the page loads correctly but a js error is generated saying that
> > > 'cocoon' is undefined. At this point, of course, no ajax works
> > >
> > > and what you are left with on submitting a page is a full page
> > > reload!!
> > >
> > > Any ideas anyone?
> > >
> > > regards
> > >
> > > Andrew
> > >
> > >
> > > ---------------------------------------------------------------------
> > > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > > For additional commands, e-mail: users-help@cocoon.apache.org
> > >
> > >
> >
>

Re: Xhtml and Ajax...no go!!

Posted by Andrew <an...@gmail.com>.
Hi,
in fact the document will not even load without the xml declaration in the
page. If you remove it you get the following error message:

Invalid byte 1 of 1-byte UTF-8 sequence.

regards

Andrew

On 26/07/06, Andrew <an...@gmail.com> wrote:
>
> Philip,
> from where do I get rid of it from? I removed the declaration from my xsl
> stylesheet, but still it remains. I checked the map:serializer section of
> the sitemap and there is nothing there either. I thought I might have a
> caching issue on my server so I restarted it, still no go.
>
> regards
>
> Andrew
>
>
> On 26/07/06, Fennell, Philip <ph...@hp.com> wrote:
> >
> > Andrew,
> >
> > Although I cannot comment on your stated problem I was drawn to reply
> > because I noticed that your example XHTML output had an XML declaration
> > at the start:
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> >
> > If you want the web pages you are generating to render as best as
> > possible across all browsers then you need to drop the XML declaration.
> > Internet Explorer 6 will not run in standards compliance mode, even with
> >
> > the correct DOCTYPE declaration, if the XML declaration is there too.
> >
> >
> >
> > Regards
> >
> > Philip Fennell
> >
> >
> >
> >
> >
> > ________________________________
> >
> > From: Andrew [mailto: andrewmadu@gmail.com]
> > Sent: 26 July 2006 09:21
> > To: users@cocoon.apache.org
> > Subject: Xhtml and Ajax...no go!!
> >
> >
> > Hi,
> > can someone please tell me why when setting ajax="true" in my CForm and
> > serializing the document as xhtml (Strict) the following line in the
> > xhtml output should break the page?:
> >
> >
> > <?xml version="1.0" encoding="ISO-8859-1"?>
> > <!DOCTYPE page PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
> > http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
> > <http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd > ">
> > .........
> >
> > <form action
> > ="updateAccounts.kont" ajax="true" name=
> > "Form1" method="POST" dojoType="CFormsForm"
> > >
> > <script type=
> > "text/javascript">cocoon.forms.ajax = true;</script
> > >
> >
> > What is it about the script line that xhtml does not like? My ajax map
> > is:
> >
> >                                 <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>
> >
> >
> > If I change the forms-styling-*.xsl document to an indclude js file.
> > <script src="" />, which contains that one line of js,
> > the page loads correctly but a js error is generated saying that
> > 'cocoon' is undefined. At this point, of course, no ajax works
> >
> > and what you are left with on submitting a page is a full page reload!!
> >
> > Any ideas anyone?
> >
> > regards
> >
> > Andrew
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> > For additional commands, e-mail: users-help@cocoon.apache.org
> >
> >
>

Re: Xhtml and Ajax...no go!!

Posted by Andrew <an...@gmail.com>.
Philip,
from where do I get rid of it from? I removed the declaration from my xsl
stylesheet, but still it remains. I checked the map:serializer section of
the sitemap and there is nothing there either. I thought I might have a
caching issue on my server so I restarted it, still no go.

regards

Andrew

On 26/07/06, Fennell, Philip <ph...@hp.com> wrote:
>
> Andrew,
>
> Although I cannot comment on your stated problem I was drawn to reply
> because I noticed that your example XHTML output had an XML declaration
> at the start:
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
>
> If you want the web pages you are generating to render as best as
> possible across all browsers then you need to drop the XML declaration.
> Internet Explorer 6 will not run in standards compliance mode, even with
> the correct DOCTYPE declaration, if the XML declaration is there too.
>
>
>
> Regards
>
> Philip Fennell
>
>
>
>
>
> ________________________________
>
> From: Andrew [mailto:andrewmadu@gmail.com]
> Sent: 26 July 2006 09:21
> To: users@cocoon.apache.org
> Subject: Xhtml and Ajax...no go!!
>
>
> Hi,
> can someone please tell me why when setting ajax="true" in my CForm and
> serializing the document as xhtml (Strict) the following line in the
> xhtml output should break the page?:
>
>
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <!DOCTYPE page PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
> http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
> <http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd> ">
> .........
>
> <form action
> ="updateAccounts.kont" ajax="true" name=
> "Form1" method="POST" dojoType="CFormsForm"
> >
> <script type=
> "text/javascript">cocoon.forms.ajax = true;</script
> >
>
> What is it about the script line that xhtml does not like? My ajax map
> is:
>
>                                 <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>
>
>
> If I change the forms-styling-*.xsl document to an indclude js file.
> <script src="" />, which contains that one line of js,
> the page loads correctly but a js error is generated saying that
> 'cocoon' is undefined. At this point, of course, no ajax works
>
> and what you are left with on submitting a page is a full page reload!!
>
> Any ideas anyone?
>
> regards
>
> Andrew
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
>
>

RE: Xhtml and Ajax...no go!!

Posted by "Fennell, Philip" <ph...@hp.com>.
Andrew,
 
Although I cannot comment on your stated problem I was drawn to reply
because I noticed that your example XHTML output had an XML declaration
at the start:
 
<?xml version="1.0" encoding="ISO-8859-1"?>

If you want the web pages you are generating to render as best as
possible across all browsers then you need to drop the XML declaration.
Internet Explorer 6 will not run in standards compliance mode, even with
the correct DOCTYPE declaration, if the XML declaration is there too.



Regards

Philip Fennell 

 
 


________________________________

From: Andrew [mailto:andrewmadu@gmail.com] 
Sent: 26 July 2006 09:21
To: users@cocoon.apache.org
Subject: Xhtml and Ajax...no go!!


Hi,
can someone please tell me why when setting ajax="true" in my CForm and
serializing the document as xhtml (Strict) the following line in the
xhtml output should break the page?:


<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE page PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "
http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
<http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd> ">
.........

<form action
="updateAccounts.kont" ajax="true" name=
"Form1" method="POST" dojoType="CFormsForm"
>
<script type=
"text/javascript">cocoon.forms.ajax = true;</script
>

What is it about the script line that xhtml does not like? My ajax map
is:

				<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>


If I change the forms-styling-*.xsl document to an indclude js file.
<script src="" />, which contains that one line of js, 
the page loads correctly but a js error is generated saying that
'cocoon' is undefined. At this point, of course, no ajax works 

and what you are left with on submitting a page is a full page reload!! 

Any ideas anyone?

regards

Andrew


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