[mod_python] mod_python and xml parsing

Manfred Stienstra manfred.stienstra at dwerg.net
Thu Jun 24 23:07:50 EDT 2004


On Thu, 2004-06-24 at 00:42, Dan Olsen wrote:
> from mod_python import apache
> import xml.dom.minidom
> import urllib
> 
> def crazy(req, url):
>     sock = urllib.urlopen( url )
>     indata = sock.read()
>     sock.close()
>     dom = parse(indata)
>     return "<html>PASS</html>"

> Can anyone help me figure out what I am doing wrong? I have tried 
> tweaking the code a little bit but with no luck.  Is there some 
> documentation out there that I can read about mod_python and parsing XML?

The function parse is not defined. You probably want something like
xml.dom.minidom.parseString(indata).

Manfred



More information about the Mod_python mailing list