Newbie XML Output question

Discussion in 'Python' started by kryten21, Sep 4, 2006.

  1. kryten21

    kryten21 Guest

    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
     
    kryten21, Sep 4, 2006
    #1
    1. Advertising

  2. kryten21

    kryten21 Guest

    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
    >
     
    kryten21, Sep 4, 2006
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Grant Harmeyer

    asp:Xml control and Xml output

    Grant Harmeyer, Feb 3, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    2,114
    Chris Jackson
    Feb 3, 2004
  2. ricky
    Replies:
    1
    Views:
    827
    Joris Gillis
    Oct 17, 2004
  3. J Bondo
    Replies:
    5
    Views:
    815
    J Bondo
    Jan 19, 2009
  4. Mav
    Replies:
    22
    Views:
    389
  5. Erik Wasser
    Replies:
    5
    Views:
    527
    Peter J. Holzer
    Mar 5, 2006
Loading...

Share This Page