The XMLDBTransformer comes with the xmldb block and allows to perform operations on any XML:DB database:

  • Create Collection
  • Create Document
  • Update Document
  • Delete Document

Here's a sitemap snippet that configures a transformer named xmldb that connects to Xindice running on the local host:

<map:transformers default="xslt">
  <map:transformer name="xmldb" src="org.apache.cocoon.transformation.XMLDBTransformer">
    <driver>org.apache.xindice.client.xmldb.DatabaseImpl</driver>
    <base>xmldb:xindice://localhost:8888/db</base>
  </map:transformer>
  ...
</map:transformers>

NOTE: Xindice 1.0 uses port 4080, Xindice 1.1 running on embedded Jetty uses port 8888, Xindice installed on Tomcat or some other servlet engine will be using port number of this servlet engine, usually, 8080.

See Javadoc and populate.xml for examples of using the transformer.

Cocoon 2.1.4 has a copy of xindice-1.1b3.jar bundled into the distribution. If you use different Xindice version, replace this jar with the version you need from the Xindice distribution.

  • No labels