cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Subrahmanya, Noida" <>
Subject RE: Transformer Creates Error in getContentAsSAX
Date Tue, 12 Nov 2002 07:03:54 GMT

-----Original Message-----
From: Gianugo Rabellino []
Sent: Monday, November 11, 2002 04:24 PM
Subject: Re: Transformer Creates Error in getContentAsSAX

Subrahmanya, Noida wrote:

 > I have database setup with XMLResource Chani at collection Mytown
 > University/Student applications/
 > Note Statement i is being commented. When request  for url
 > http://localhost:8080/cocoon/demodb/Chani it completely displays
 > Chani XML on browser. But by being statement 1 uncommented it throws
 > attched exception.
 > What could be the reason? I think in first case it looks for transformer
 > . If it is not there it calls getContent or else getContentAsSAX.
 > Is there any Idia. Is it possible to use cutomer code to generate XML
 > enevts for XML:DB pseudo protocol. If yes any idea to how go about it?

first of all please try to avoid HTML in your mail, as I (and I think 
many others out there) have troubles in following you with your current 
e-mail setup (hint: have a look at

Now for your problem: it's weird. IIUC (but please confirm) when you are 
using just a generator and a serializer everything works fine, but when 
you add a transformer you get that exception. This definitely shouldn't 
happen: from the generator POV a Serializer, just like a Transformer, 
acts as a ContentHandler, so there should be no difference at all in the 
way the XMLDB Source works. In both cases getContentAsSAX() is called, 
so there is no difference in the behaviour of the component. Do you have 
any sensible information in the Cocoon logs?

Let me know,

Gianugo Rabellino

Dear  Gianugo Rabellino,
We are using xml pseudo protocol for Graduate-Publish demo. Using this we
are able to display XML content on browser. 
But it was giving error  for XSLT transformation.  we have pointed out the
reason for this error. 
Consider following snippet of code is called by method getContentAsSAX().
    public void parse(final DBDocument dbdoc) throws SAXException {
        if (parseInProgress) {
            this.error( new SAXParseException("You may not parse again while
parse is in progress ", locator));
        if (dbdoc == null) {
            this.fatalError(new SAXParseException(null, null, new
        this.setDocumentLocator(locator);//TO DO: Better understanding of
Locator //Statement 1
        org.w3c.dom.Element documentElement = null;
        try {
            documentElement = getElement(dbdoc);
        } catch (Exception e) {
            this.fatalError(new SAXParseException(null, locator, e));
Cocoon 2 XSL transformation makes use of DocumentLocator which might be not
be implemented properly in SocratesXML.
Statement 1  was giving attached error, passing null to method
setDocumentLocator. Commenting this we are able to proceed.

Further is there any way to pass username and password to xmldb:protocol as
in default it calls org.xmldb.api.DatabaseManager which in tern calls
DatabaseImpl.getCollection(uri,username,password) by supplying null and null
to username and password respectively?.
Suppose i have enhanced DatabaseManager ( say ordbxml.xmldb.DatabaseManager
) which was derived from org.xmldb.api.DatabaseManager  to add some extra
methods. How could i configure to use this?.

With Thanks and Regards,
B. Subrahmanya Nayak
Member Technical Staff,
HCL Technologies Ltd.,
Net Centric Division,
B-41, A-11,Sector 16,
Noida - 201301
Ph: 118-4510701/702/813 Extn: 3028


This document is intended for transmission to the named recipient only. If
you are not that person, you should note that legal rights reside in this
document and you are not authorized to access, read, disclose, copy, use or
otherwise deal with it and any such actions are prohibited and may be
unlawful. The views expressed in this document are not necessarily those of
HCL Technologies Ltd. Notice is hereby given that no representation,
contract or other binding obligation shall be created by this e-mail, which
must be interpreted accordingly. Any representations, contractual rights or
obligations shall be separately communicated in writing and signed in the
original by a duly authorized officer of the relevant company.
To unsubscribe, e-mail:
For additional commands, email:

View raw message