cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robby Pelssers <Robby.Pelss...@nxp.com>
Subject RE: Problem with query in Cocoon
Date Thu, 22 Mar 2012 08:24:14 GMT
The error message seems obvious although my French is a bit out of date ;-)

The query does not return xml and hence you run into this exception.  I also noticed you set
a parent-id parameter but it’s not used in your query. I guess that’s because you simplified
the xquery.  As I can’t test for you if that xquery does indeed return a valid XML result
it’s a bit hard to pinpoint the exact issue.  The only sensible thing to do is to first
write a parameterless xquery and make sure it returns results.  Next try that same xquery
with the xquery generator.  But from the looks of it you already tried this?!

Robby

From: Patricia Déchandol [mailto:pdechandol@ajlsm.com]
Sent: Thursday, March 22, 2012 9:14 AM
To: users@cocoon.apache.org
Subject: Re: Problem with query in Cocoon

Thanks Robby
I will try it but I have already tried this :

xquery version "1.0";
(: $Id: get-children-rubriques.xq 12373 2008-10-15 14:41:34Z pdechandol $ :)

(:     XQuery qui retourne la collection de notices Bmgexporub liée à une notice parent
:)

let $rubriques := fn:collection('Bmgexporub')/record[lien_rubrique_parent='Bmgexporub-0000002']
return
<records>
</records>

and it failed with the same error.

I wonder if it's the .xq which makes problem or something somewhere else in cocoon.
My xquery gives results when I execute it from eXist graphic java client.

Patricia


Le 22 mars 2012 à 09:08, Robby Pelssers a écrit :


You might give this a try:

xquery version "1.0";
(: $Id: get-children-rubriques.xq 12373 2008-10-15 14:41:34Z pdechandol $ :)

(:     XQuery qui retourne la collection de notices Bmgexporub liée à une notice parent
:)

let $rubriques := fn:collection('Bmgexporub')/record[lien_rubrique_parent='Bmgexporub-0000002']
return
<records>
  {
    for $rubrique in $rubriques
    return $rubrique
  }
</records>

Robby


From: Patricia Déchandol [mailto:pdechandol@ajlsm.com]
Sent: Wednesday, March 21, 2012 12:22 PM
To: users@cocoon.apache.org<mailto:users@cocoon.apache.org>
Subject: Problem with query in Cocoon

Hi everybody,

new problem !

I try to execute query from cocoon

I declared a xquery generator in my sitemap :

<map:generator name="xquery" logger="sitemap.generator.xquery" src="org.exist.cocoon.XQueryGenerator"
       collection="xmldb:exist://localhost:8899/exist/xmlrpc/db"
       user="admin"
       password="admin"
       create-session="false"
       expand-xincludes="false"
       authen=""
       cache-validity="-1"
                     />

I match a pattern corresponding :

<map:match pattern="**/get-children-rubriques.xml">
       <map:generate type="xquery" src="xq/get-children-rubriques.xq">
              <map:parameter name="parentid" value="{request-param:parentid}"/>
       </map:generate>
       <map:serialize type="xml"/>
       </map:match>

I prepared the following .xq:

xquery version "1.0";
(: $Id: get-children-rubriques.xq 12373 2008-10-15 14:41:34Z pdechandol $ :)

(:     XQuery qui retourne la collection de notices Bmgexporub liée à une notice parent
:)

let $rubriques := fn:collection('Bmgexporub')/record[lien_rubrique_parent='Bmgexporub-0000002']
<records>
       return $rubriques
</records>

Executing the following URL : http://localhost:8080/bm-grenoble/Bmgexporub/get-children-rubriques.xml?parentid=Bmgexporub-0000002
the response is this one :

Erreur d'analyse XML : aucun élément trouvé
Emplacement : http://localhost:8080/bm-grenoble/Bmgexporub/get-children-rubriques.xml?parentid=Bmgexporub-0000002
Numéro de ligne 1, Colonne 1 :

with the following logs :

<parsererror>
Erreur‌·d'analyse‌·XML&nbsp;:‌·aucun‌·élément‌·trouvé‌¶Emplacement&nbsp;:‌·http://localhost:8080/bm-grenoble/Bmgexporub/get-children-rubriques.xml?parentid=Bmgexporub-0000002‌¶Numéro‌·de‌·ligne‌·1,‌·Colonne‌·1&nbsp;:
<sourcetext>‌¶^</sourcetext>
</parsererror>

I checked that my query request is correct by testing in the eXist client.
I can't understand at which level there's an error… lo log in tomcat !!!

Patricia





Mime
View raw message