Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > Newbie XML Output question

Reply
Thread Tools

Newbie XML Output question

 
 
kryten21
Guest
Posts: n/a
 
      09-04-2006
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

 
Reply With Quote
 
 
 
 
kryten21
Guest
Posts: n/a
 
      09-04-2006
Sorry, there should be no "req.write(file)" there.


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


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Newbie: Almost empty output when translating from DocBook to XML,why? J Bondo XML 5 01-19-2009 09:29 AM
Different results parsing a XML file with XML::Simple (XML::Sax vs. XML::Parser) Erik Wasser Perl Misc 5 03-05-2006 10:09 PM
XSL & XML newbie: How to get rid of blank lines in output?? ricky XML 1 10-17-2004 08:28 PM
Newbie: How do I filter output to the screen and writing the orginal output to a file? Mav Perl Misc 22 07-09-2004 09:56 PM
asp:Xml control and Xml output Grant Harmeyer ASP .Net 1 02-03-2004 03:25 PM



Advertisments