<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
<font size="-1"><font face="Helvetica, Arial, sans-serif">That's a typo
I used <br>
<br>
from xml.dom.minidom import parse, parseString<br>
<br>
I can get it to work if you just run it under python on my local
machine. It's when I run it under mod_python I get the error:<br>
<br>
</font></font>
<pre>AttributeError: 'module' object has no attribute 'parse'
<font face="Helvetica, Arial, sans-serif">Any other ideas of what could be wrong?
Dan
</font></pre>
<br>
Manfred Stienstra declared on 06/24/2004 02:07 PM:
<blockquote cite="mid1088107670.13505.2.camel@ack.dwerg.net" type="cite">
<pre wrap="">On Thu, 2004-06-24 at 00:42, Dan Olsen wrote:
</pre>
<blockquote type="cite">
<pre wrap="">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>"
</pre>
</blockquote>
<pre wrap=""><!---->
</pre>
<blockquote type="cite">
<pre wrap="">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?
</pre>
</blockquote>
<pre wrap=""><!---->
The function parse is not defined. You probably want something like
xml.dom.minidom.parseString(indata).
Manfred
_______________________________________________
Mod_python mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Mod_python@modpython.org">Mod_python@modpython.org</a>
<a class="moz-txt-link-freetext" href="http://mailman.modpython.org/mailman/listinfo/mod_python">http://mailman.modpython.org/mailman/listinfo/mod_python</a>
</pre>
</blockquote>
</body>
</html>