cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anders Conrad" ...@dsl.dk>
Subject Re: How can I access XML Native database using cocoon
Date Fri, 14 Dec 2001 09:46:26 GMT
As far as I understand, there are some taglibs supporting relational
databases for Cocoon XSP, but I have not come across any direct support for
native XML databases.

I am myself working on accessing an Xindice (dbXML) database through Cocoon
XSP and that is not very complicated to get to work. My database is on the
same server as Cocoon and I have used the dbXML java interface (as in the
dbXML Example1.java program) and implemented this in <xsp:logic> elements of
an XSP page. The only modification to the dbXML code - apart from collection
name and query string - is that you have to cast the returned resource as
XMLResource and use the getResultAsDOM method to get the DOM node into your
XSP page, something like

  XMLResource res = (XMLResource) results.nextResource();
  // Resultat ind i en DOM node
  Document diplom = (Document) res.getContentAsDOM();
  // Get the top node of the returned document
  Element fetchedDoc = diplom.getDocumentElement();

Now, this can be cloned into the DOM structure of the XSP page:

    <xsp:expr>XSPUtil.cloneNode(fetchedDoc, document)</xsp:expr>

and from there on you can do further processing in Cocoon, directly on the
nodes from your database.

It is quite simple but it seems to work. The only problem I have encountered
is that UTF-8 encoding in the DOM nodes returned from the database is
ignored somewhere in the processing as I wrote about to the list yesterday.

Anders


----- Original Message -----
From: "Kukkapalli PraveenKumar" <kupraku@rediffmail.com>
To: <cocoon-users@xml.apache.org>
Sent: Thursday, December 13, 2001 11:55 AM
Subject: How can I access XML Native database using cocoon



Hi all,
   I'm new to cocoon and this mailing list as well. I read that Cocoon is
supporting Native Databases and downloaded the Cocoon and installed in my
machine but I didn't get any Info. from the site that how to access native
database.
I'm using dbXML(Xindice).My frontend is XML and using DOM.I've to go to so
many pages and fill some forms, all the information I've given is stored as
DOM and whenever I submit that should submit to the database. Does it
supports.Please let me know..
Best wishes
Praveen


---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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



---------------------------------------------------------------------
Please check that your question has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faqs.html>

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


Mime
View raw message