Katharina,

I have taken your source and modofied it to the way I use exist.

My site map fragment reads:

<!-- test -->
<map:pipeline>
        <map:match pattern="test.html">
                <map:generate 
src="xmldb:exist://localhost/exist/xmlrpc/db/addressbook/contacts.xml"/>
                <map:transform src="simple.xslt"/>
                <map:serialize type="html"/>
        </map:match>
</map:pipeline>

I grab the data from exist using the XMLDB protocol in a generator. Your contact list 
is stored in the addressbook 
collection with name contacts.xml. Personally I would store each contact under a 
different file called {id}.xml so you 
can take advantage of exists search capability whilst making insters/updates/deletes 
much simpler as you are dealing 
with seperate files.

The XML returned from exist reads:

  <?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>Wunschelbrunn</city> 
        <postalcode>55555</postalcode> 
      </address>
    </contact>
  </contacts>

The xslt document to show this as HTML reads:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"; version="1.0">

<xsl:template match="contacts">
        <html>    
                <head>
                        <title>Contact List</title>
                </head>
                <body bgcolor="#FFFFFF">
                        <table border="1">
                                <tr>
                                        <th colspan="5">Contact List</th>
                                </tr>
                                <xsl:apply-templates select="contact"/>
                        </table>
                </body>
        </html>
</xsl:template>
<xsl:template match="contact">
        <tr>
                <td><xsl:value-of select="@id"/></td>
                <td><xsl:value-of select="address/street"/></td>
                <td><xsl:value-of select="address/number"/></td>
                <td><xsl:value-of select="address/city"/></td>
                <td><xsl:value-of select="address/postalcode"/></td>
        </tr>
</xsl:template>

</xsl:stylesheet>

As you can see this is not complex, but you need to make sure you match on the root 
node of the xml document that is 
returned from exist.

To get the XMLDB protocol working within the sitemap you must make sure you have:

<!-- xmldb pseudo protocol -->
<component-instance 
class="org.apache.cocoon.components.source.impl.XMLDBSourceFactory" name="xmldb">
    <!-- exist driver -->
    <driver class="org.exist.xmldb.DatabaseImpl" type="exist"/>
</component-instance>

... in the cocoon configuration file, under WEB-INF/cocoon.xconf in your cocoon web 
application directory.

I'm sorry I can't help with the xmldb transformer, but I feel the xmldb protocol is 
much more powerful, and I hope 
this simple example helps you.

Paul.

--
Paul Bowler
Aventix Associates Ltd


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

Reply via email to