forrest-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Turner <je...@apache.org>
Subject Re: Error: When accessing XSP page (Namespace forprefix 'xmldb' has not been declared)
Date Wed, 30 Jul 2003 11:57:53 GMT
On Tue, Jul 29, 2003 at 08:29:43PM -0400, Leo wrote:
> Hi folks
> 
> I have the configurations for XSP in forrest(in cocoon.xconf) set up and
> this
> works fine when there are no xmldb namespace references.
> 
> I also have in cocoon.xconf builtin-logicsheet for xmldb
>         <builtin-logicsheet>
>             <parameter name="prefix" value="xmldb"/>
>             <parameter name="uri" value="http://exist-db.org/xmldb/1.0"/>
>             <parameter name="href" value="resource://org/exist/xmldb.xsl"/>
>         </builtin-logicsheet>
> 
> Trying to access an XSP page(simple1.xsp) with references to xmldb:
> <xsp:page xmlns:xsp="http://apache.org/xsp"
>           xmlns:xmldb="http://exist-db.org/xmldb/1.0">
> .
> .
> 		 <xsp:logic>
>      			String doc = request.getParameter("doc");
>                 	if(doc != null &amp;&amp; doc.length() &gt; 0) {
>                 		<p>Retrieving document <xsp:expr>doc</xsp:expr></p>
> 		                <xmldb:collection
> uri="xmldb:exist:///db/shakespeare/plays"
> 		                	user="guest" password="guest">
> 		                    <xml-source>
> 		                        <xmldb:get-document encoding="ISO-8859-1"
> as="xml">
> 		                             <xmldb:name>doc</xmldb:name>
> 		                        </xmldb:get-document>
> 		                    </xml-source>
> 		                </xmldb:collection>
> 		            }
> 	            </xsp:logic>


XSP pages must be valid XML documents.  Whenever you use a namespace
prefix, you need to first map it to a namespace URI.  In the XML above,
you're using the 'xmldb' prefix (in the xmldb:collection element) which
has no mapping.  You can declare the mapping with an extra attribute:

                   <xmldb:collection xmlns:xmldb="...."

Setting .... to whatever the correct namespace is.


--Jeff

> The problem
> 20:01:06.974 EVENT  ERROR   (2003-07-29) 20:01.06:964   [access  ]
> (/functions/s
> imple1.xsp) PoolThread-3/CocoonServlet: Internal Cocoon Problem
> org.apache.cocoon.ProcessingException: java.lang.RuntimeException: Namespace
> for
>  prefix 'xmldb' has not been declared.: java.lang.RuntimeException:
...


> 
> Regards
> Leo
> 

Mime
View raw message