You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Rob Parker <ro...@webcybernetics.com> on 2000/06/20 13:44:36 UTC

SQLFilter: Not expecting an end value element

I know somebody else was getting this exception recently, but I can't find
any followups...So if there was a solution, please let me know.

This was previously working. Currently using latest build from cvs (cocoon2.0).

regards

Rob

Re: SQLFilter: Not expecting an end value element SOLVED!

Posted by Rob Parker <ro...@webcybernetics.com>.
OK here's what's going wrong...

C2 won't work with xerces1_0_3 for me, but I got it to run with xerces1_1_1.
xerces1_1_1 seems to be the cause of the problem. In the SQLFilter, the code
uses
the namespace attribute to determine whether the Sax event should be handled
by itself
or passed to the super class. Thus in the example below, when SQLFilter
receives the end
element event, the uri is still set to the SQL namespace and hence the
SQLFilter trys to handle
the event whilst in an invalid state.

Now if I use xerces1_0_4, both C2 work and the SQLFilter now works as I
expect again. One
small outstanding issue, the actual sql query string is still returned
before the serialized result set...

 <?xml version="1.0" encoding="iso-8859-1"?>
 <page >
   <title>Hello</title>
   <content>
     <para>This is my first Cocoon2 page filled with sql data!</para>
     <execute-query xmlns="http://xml.apache.org/cocoon/SQL">
       <query>
         select NAME, NICK_NAME from WINERY
       </query>
     </execute-query>
   </content>
 </page>



Re: SQLFilter: Not expecting an end value element

Posted by Rob Parker <ro...@webcybernetics.com>.
----- Original Message -----
From: Donald Ball <ba...@webslingerZ.com>
To: <co...@xml.apache.org>; Rob Parker <ro...@webcybernetics.com>
Sent: Wednesday, June 21, 2000 1:54 AM
Subject: Re: SQLFilter: Not expecting an end value element


> er, no, well, i haven't touched sqlfilter in a long while. flip me a page
> with your prob and i'll take a peek - or dig into source yerself -

This throws the error...

<?xml version="1.0" encoding="iso-8859-1"?>
<page xmlns:sql="http://xml.apache.org/cocoon/SQL">
  <title>Hello</title>
  <content>
    <para>This is my first Cocoon2 page filled with sql data!</para>
    <execute-query xmlns="http://xml.apache.org/cocoon/SQL">
      <query>
        select NAME, NICK_NAME from WINERY
      </query>
    </execute-query>
  </content>
</page>

The problem is that on receipt of end element 'content', the filter is in
the 'OUTSIDE' state.
It has been set to the OUTSIDE state by the end of the query execution. Thus
on endElement,
it is expecting to be in the STATE_INSIDE_VALUE_ELEMENT.

If I change the page to...

<?xml version="1.0" encoding="iso-8859-1"?>
<execute-query xmlns="http://xml.apache.org/cocoon/SQL">
    <query>
      select NAME, NICK_NAME from WINERY
    </query>
 </execute-query>

Then it kinda works - as in I get the serialized result set back.

So as I see it, the SQLFilter seems to need to push states onto a stack, so
any
further insights would be useful. However I'll keep debugging :-)



Re: SQLFilter: Not expecting an end value element

Posted by Donald Ball <ba...@webslingerZ.com>.
er, no, well, i haven't touched sqlfilter in a long while. flip me a page
with your prob and i'll take a peek - or dig into source yerself -
maintaining sqlfilter isn't truly high on my priority list since i'm not
using cocoon2 yet.

- donald

On Tue, 20 Jun 2000, Rob Parker wrote:

> I know somebody else was getting this exception recently, but I can't find
> any followups...So if there was a solution, please let me know.
> 
> This was previously working. Currently using latest build from cvs
> (cocoon2.0).
> 
> regards
> 
> Rob
>