cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paul Bowler" <paulbow...@www.aventix.co.uk>
Subject Re: Connecting Cocoon 2.1 with eXist 0.9.2 ???
Date Thu, 30 Oct 2003 10:22:05 GMT
When debugging things like this (I also used exist a lot) I find it best to test each transformation
in turn.

Try changing your sitemap match to:

<map:match pattern="adressen">
    <map:generate src="TEST/xml/samples/adressen.xml"/>
    <map:transform type="exist_xmldb">
        <map:parameter name="base" value="xmldb:exist://localhost:8080/exist/xmlrpc/db/addressbook"/>
    </map:transform>
    <!--
    <map:transform src="TEST/xsl/samples/simple2.xsl"/>
    -->
    <map:serialize type="xml"/>
</map:match>

This will show you what comes back from the exist call. You are probably not receiving back
what you think.

Regards,

Paul.

--
Paul Bowler
Aventix Associates Ltd

---------- Original Message -----------
From: "Katharina Weimer" <katharina_Weimer@gmx.de>
To: "'users@cocoon.apache.org'" <users@cocoon.apache.org>
Sent: Thu, 30 Oct 2003 10:19:46 +0100 (MET)
Subject: Connecting Cocoon 2.1 with eXist 0.9.2 ???

> Hi everyone,
> 
> I'mquite new to Cocoon and having difficulties in connecting to eXist from
> Cocoon 2.1.
> I'm not that sure if I did anything right - I would appreciate it very much
> if anyone could have a look at it....
> 
> Ok, I'm using exist 0.9.2, Tomcat 4.1.27 and Cocoon 2.1 .
> I have files like that in the database under /db/addressbook:
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <contacts xmlns:exist="http://exist.sourceforge.net/NS/exist">
>     <contact id="hermann">
>         <name>Hermann Lang</name>
>         <address>
>             <street>Himmelweg</street>
>             <number/>
>             <city>Echterdingen</city>
>             <postalcode>70771</postalcode>
>         </address>
>     </contact>
>     <contact id="ilse">
>         <name>Ilse Honig</name>
>         <address>
>             <street>Wollkengasse</street>
>             <number>15</number>
>             <city>Wünschelbrunn</city>
>             <postalcode>55555</postalcode>
>         </address>
>     </contact>
> </contacts>
> 
> My sitemap.xmap looks like this:
> ...
> <map:transformer name="exist_xmldb"
> src="org.apache.cocoon.transformation.XMLDBTransformer">
> <driver>org.exist.xmldb.DatabaseImpl</driver>
> <base>xmldb:exist://localhost:8080/exist/xmlrpc/db/</base>
> </map:transformer>
> ...
>  
> ...
> <map:match pattern="adressen">
> <map:generate src="TEST/xml/samples/adressen.xml"/>
> <map:transform type="exist_xmldb">
> <map:parameter name="base"
> value="xmldb:exist://localhost:8080/exist/xmlrpc/db/addressbook"/>
> </map:transform>
> <map:transform src="TEST/xsl/samples/simple2.xsl"/>
> <map:serialize encoding="UTF-8" type="html"/>
> </map:match>
> ...
>  
> 
> adressen.xml
> 
> <?xml version="1.0" encoding="iso-8859-1"?>
> <document>
>     <body>
>     <section title="Datenbankabfragen">
>  
>     <exist_xmldb:collection
> xmlns:exist_xmldb="http://exist-db.org/transformer/1.0" 
uri="xmldb:exist://localhost:8080/exist/xmlrpc/db/addressbook">
>  
>  <chapter> 
>     <exist_xmldb:execute>
>  
>     <exist_xmldb:path> //adress </exist_xmldb:path>
>  
>     <p>   Found <exist_xmldb:get-hit-count/> hits   </p>
>  
>      <exist_xmldb:results>
>         <exist_xmldb:get-xml as="string"/>
>      </exist_xmldb:results>
>  
>         </exist_xmldb:execute>
>     </chapter> 
> </exist_xmldb:collection> 
>  
> </section>
> </body>
> </document>
> 
> simple2.xsl
> 
> <?xml version="1.0" encoding="UTF-8"?>
> <xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
> version="1.0">
>  
> <xsl:template match="document">
>     <html>    
>         <head>
>             <title>
>                 <xsl:value-of select="body/section/@title"/>
>             </title>
>          </head>
>         <body bgcolor="#FFFFFF">
>             <table width="100%" border="0" cellpadding="10" cellspacing="0">
>                 <tr valign="center">
>                     <td valign="bottom">
>                             <xsl:value-of select="body/section/@title"/>
>                     </td>
>                     <td valign="bottom">
>                              <xsl:value-of
> select="body/section/chapter/text()"/>
>                     </td>
>                 </tr>
>                 <tr valign="center">
>                         <td valign="bottom">
>                         </td>
>                         <td valign="bottom">
>                         </td>    
>                 </tr>
>             </table>
>         </body>
>     </html>
> </xsl:template>
> </xsl:stylesheet>
> 
> When I'm starting that, I just get an HTML-page...but without any results..
> 
> Does anyone have clue what I'm doin' wrong?
> ..I'm getting desperated...
> 
> Thanks very much in advance.....
> Katharina
> 
> -- 
> HAKUNA MATATA !!!
> 
> NEU FÜR ALLE - GMX MediaCenter - für Fotos, Musik, Dateien...
> Fotoalbum, File Sharing, MMS, Multimedia-Gruß, GMX FotoService
> 
> Jetzt kostenlos anmelden unter http://www.gmx.net
> 
> +++ GMX - die erste Adresse für Mail, Message, More! +++
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
> For additional commands, e-mail: users-help@cocoon.apache.org
------- End of Original Message -------


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


Mime
View raw message