xml-xindice-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Nina Juliadotter" <nvjul...@it.uts.edu.au>
Subject xmldb namespace in xindice results file
Date Wed, 21 Apr 2004 03:33:09 GMT
Hi everyone,

I've come across a strange problem that I'm not sure how to get around, or if it's
just me doing something wrong.

Short description:
When I use cocoon to query the xindice database and display the results, the result
file generated has an undeclared namespace "xmldb". This has the effect that I can't
do anything with the result, as cocoon will tell me that "The prefix "xmldb" for
element "xmldb:results" is not bound." How do you get around this???

Long description:
When I query xindice with a sitemap like this:

    <map:match pattern="styleremote/**">
      <map:generate src="xmldb:xindice://localhost:8080/db/restaurants/#{1}"/>
<map:transform type="xslt" src="xsl/result.xsl"/>
      <map:serialize type="html"/>

and the url is

http://localhost:8080/cocoon/nina1/styleremote/restaurant[name='La Scala']

then the "<map:generate src="xmldb:xindice://localhost:8080/db/restaurants/#{1}"/>"
bit generates the following:

<?xml version="1.0" encoding="ISO-8859-1"?>
<xmldb:results query="/restaurant[name='La Scala']" resources="1"> <xmldb:result
<restaurant src:col="/db/restaurants" src:key="LaScala"
  <name>La Scala</name>
        <streetName>Norton street</streetName>
    <phoneNumber>(02) 9765 4321</phoneNumber>

My style sheet is just a "print everyting out":

<?xml version="1.0" ?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" version="1.0">
<xsl:output method="html" indent="yes"/>
<xsl:template match="/">
	<tr><td><xsl:apply-templates /></td></tr>

Cocoon gives me the error:

org.apache.cocoon.ProcessingException: Failed to execute pipeline.:
The prefix "xmldb" for element "xmldb:results" is not bound.

Obviously this could be solved by adding a declaration of xmldb namespace in both
the generated file and the stylesheet. But this is not realistic as I need to work
with the generated result on the fly, and anyway, I shoudln't have to.

Any ideas?


View raw message