[XML-SIG] CGI Problem solved (sort of)

Michael Hall olc@ninti.com
Mon, 26 Aug 2002 21:55:40 +0930 (CST)


I have solved the problem described below simply by changing this line in 
my CGI script:

#!/usr/bin/python2

to this:

#!/usr/bin/python

I don't know why, by python2 won't do the transformation whereas good old 
python 1.5.2 will. Maybe it is an issue with where or how I installed 
PyXML?

Anyway, forward ever backward never :-)

Mick


ORIGINAL MESSAGE BELOW:

I have a Python CGI script that converts XML to HTML using XSLT (PyXML).
The script produces beautiful output to standard out if called from the 
command line, but will not work if called via http. Other simpler 
Python CGI scripts in the same directory that simply print "Hello World" 
work fine.

This is the output I get from the xml2html.py script:
Traceback (most recent call last): File "/home/olc/cgi-bin/xml2html.py", line 21, in ? xsltproc.appendStylesheetUri(stylesheet) 
File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/Processor.py", line 95, in appendStylesheetUri sty = 
self._styReader.fromUri(styleSheetUri, baseUri) File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/StylesheetReader.py", line 
298, in fromUri ownerDoc, stripElements) File "/usr/lib/python2.2/site-packages/_xmlplus/xslt/minisupport.py", line 58, in 
fromUri return self.fromStream(stream, baseUri, ownerDoc, stripElements) File 
"/usr/lib/python2.2/site-packages/_xmlplus/xslt/StylesheetReader.py", line 305, in fromStream self.initParser() File 
"/usr/lib/python2.2/site-packages/_xmlplus/xslt/StylesheetReader.py", line 355, in initParser 
self.parser.ExternalEntityRefHandler = self.handler.entityRef AttributeError: StylesheetReader instance has no attribute 
'entityRef'
 
Where should I be looking for the problem? .xml file? .xsl file? .py CGI 
script? server environment? Is there something obvious I don't know about 
going on here? I've been following Jones & Drake's 'Python & XML' to the 
letter.

TIA

Mick
 



_______________________________________________
XML-SIG maillist  -  XML-SIG@python.org
http://mail.python.org/mailman/listinfo/xml-sig