[mod_python] 4XSLT/XML (4Suite) is not functioning correctly

Gregory (Grisha) Trubetskoy grisha at modpython.org
Fri Jan 10 12:39:06 EST 2003


My first guess would be something relating to current directory. In true
CGI, the current directory is set to that of where the script is located.
Mod_python doesn't do this because changing directory is not a thread-safe
thing to do. I'd try it with absolute paths to the files.

Grisha

On 10 Jan 2003, Mongryong wrote:

> I've attached two files:
>
> cgi_result.html: the correct result as outputted by cgi/standalone
> version of my script
>
> modpython_result.html: the result as outputted by a mod_python version
> of my script
>
> >From the result, you should see that the html body is empty in modpython
> version.  I've done some tests with the mod_python version of my script
> and everything seems correct up to this point:
>
> res = p.run(src, topLevelParams={'error':0} )
>
> 'res' is the result of the transformation as a string.  The
> 'request.xsl' provides instructions to the XSLT engine on how to
> transform 'request.xml' to a HTML document.  No errors or exceptions are
> thrown.  It just seems as if the 'values' in 'request.xml' are NULL
> (empty) - hence, the body of the HTML is empty.
>
> Like I said previously, I've tried switching to a different XML/XSLT
> library (libxml2/libxslt from GNOME project) and I get the same result.
>
> On Fri, 2003-01-10 at 11:05, Gregory (Grisha) Trubetskoy wrote:
> >
> > On 10 Jan 2003, Kia Vang wrote:
> >
> > > Okay, I'm really frustrated.  My code seems very simple, yet I can't get
> > > mod_python to output it correctly.
> > >
> > > Here's the mod_python code:
> > >
> > > from Ft.Xml import InputSource
> > > from Ft.Xml.Xsl import Processor
> > >
> > > from mod_python import apache
> > >
> > > def handler(req):
> > > 	p = Processor.Processor()
> > > 	trans = InputSource.DefaultFactory.fromUri("request.xsl")
> > > 	src = InputSource.DefaultFactory.fromUri("request.xml")
> > > 	p.appendStylesheet(trans)
> > > 	res = p.run(src, topLevelParams={'error':0} )
> > >
> > > 	req.content_type="text/html"
> > > 	req.write(res)
> > >
> > > 	return apache.OK
> >
> > So what specifically is wrong with the above code's behaviour? What it is
> > supposed to do and what does it really do?
> >
> > Grisha
> >
> > _______________________________________________
> > Mod_python mailing list
> > Mod_python at modpython.org
> > http://www.modpython.org/mailman/listinfo/mod_python
>
>




More information about the Mod_python mailing list