Newbie XML Output question

K

kryten21

Hi,

I was wondering if someone could help me with a problem I've been
having with mod-python and a javascript application I'm running. When
I run a GET on the actual XML file from the javascript, I can easily
parse the file. However, when I use a mod-python handler and run this
code:

LOCAL_FILE = 'htdocs/ethan/info.xml';

def get_request(req):
if req.method == 'GET':
req.content_type = "text/xml"
req.sendfile(LOCAL_FILE)
req.write(file)
return apache.OK

The file is sent but the same code that parsed the actual file can't
parse what is sent through this request. Is there some kind of special
formatting that is required to properly send back XML to a javascript
xmlhttprequest()?

Any help would be greatly appreciated,

Ethan
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top