cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Nick <goup...@muss.cis.mcmaster.ca>
Subject Re: namespaces in xmldb queries
Date Tue, 27 Jul 2004 12:54:28 GMT
Hi qMax,

It seemes that the only possible way to avoid namespaces problem is not 
to use XSLT transfotmations in any form. Thus, regular XSLTs and XSPs 
(they use logicsheets) are not suitable for this. Luckly, you can use JX 
generator to produce the XMLDB Queries. Here is an example:

JX Template:

<?xml version="1.0"?>
<page xmlns:xmldb="http://apache.org/cocoon/xmldb/1.0">
     <xmldb:query type="update" 
oid="${request.getParameter('channel')}.xml">
         <xupdate:modifications 
xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
             <xupdate:append select="/rss/channel">
               <item>
                 <title>${request.getParameter("title")}</title>
                 <link>${request.getParameter("url")}</link>
 
<description>${request.getParameter("description")}</description>
                 <author>${cocoon.parameters.userId}</author>
                 <pubDate>${pubDate}</pubDate>
                 <guid 
isPermaLink="true">http://openskysolutions.ca:8080/TaporMain/fullNewsStory?userId=${cocoon.parameters.userId}&amp;feedId=${feedId}</guid>
               </item>
             </xupdate:append>
         </xupdate:modifications>
     </xmldb:query>
     <xmldb:query type="update" oid="extendedFeedRepository.xml">
         <xupdate:modifications 
xmlns:xupdate="http://www.xmldb.org/xupdate" version="1.0">
             <xupdate:append 
select="/repository/channel[@name='${request.getParameter('channel')}']">
                 <extendedBody author="${cocoon.parameters.userId}" 
bodyId="${feedId}">${request.getParameter("fulltext")}</extendedBody>
             </xupdate:append>
         </xupdate:modifications>
     </xmldb:query>
</page>

Pipeline:

<map:match pattern="addNewsItem">
     <map:generate type="jx" src="queries/updateRssQuery.xml">
         <map:parameter name="userId" value="{ID}"/>
     </map:generate>

     <map:transform type="xmldb">
         <map:parameter name="base" 
value="xmldb:exist://myhost:8080/exist/xmlrpc/db/cocoon/rss"/>
     </map:transform>
     <map:serialize/>
</map:match>

Sorry, this is not the best example for the namespaces, but when I tried 
to use it in conjuntion with topic maps (which use namespaces 
extensively), I was able to perform the queries.

Sincerely,

ng.

qMax wrote:

> IIRC in stable cocoon release 2.1.5 there's no way to use namespaces in
> xmbdb-source queries as welll as with xmldb transformer.
> 
> Are there alternative solutions to use xml db with namespaces at all ?

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


Mime
View raw message