#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    2
    Rep Power
    0

    Post Python / XMl or PyXML .. cant figure it at all


    hi
    I am a new programmer with python and "newer" with xml.

    This is the error I have run into. Thanks in advance for all the help you can provide me.

    I have a Python CGI script which parses an XML file and returns data to be displayed.

    The CGI script ( in parts )runs well on one of my systems. However, when I shifted it to the webserver, it crashes. I figured this might be because the xml utilities are not installed on my system. My webserver is one of the nodes mounted on an NFS and I did not expect problems.

    The error I am getting relates to not being able to find any xml parsers in the system. how is this possible ?

    However, this is the error log record of my Apache 2 webserver which I am not able to figure out. I tried rebuilding the python after I installed PyXML but it still did not help. I keep getting hte same error.

    Any clues ?

    -Prashant




    ---------------------------------------------------------------------------
    [Tue Sep 02 04:22:52 2003] [error] [client 129.107.83.166] Premature end of script headers: mcp3.py, referer: http://hepfm000.uta.edu/mcp.htm
    [Tue Sep 02 04:22:52 2003] [error] [client 129.107.83.166] Traceback (most recent call last):, referer: http://hepfm000.uta.edu/mcp.htm
    [Tue Sep 02 04:22:52 2003] [error] [client 129.107.83.166] File "/usr/local/apache2/cgi-bin/mcp3.py", line 123, in ?, referer: http://hepfm000.uta.edu/mcp.htm
    [Tue Sep 02 04:22:52 2003] [error] [client 129.107.83.166] parser=make_parser(), referer: http://hepfm000.uta.edu/mcp.htm
    [Tue Sep 02 04:22:52 2003] [error] [client 129.107.83.166] File "/tmp/build-python-v2_1/lib/python2.1/xml/sax/__init__.py", line 88, in make_parser, referer: http://hepfm000.uta.edu/mcp.htm
    [Tue Sep 02 04:22:52 2003] [error] [client 129.107.83.166] xml.sax._exceptions.SAXReaderNotAvailable: No parsers found, referer: http://hepfm000.uta.edu/mcp.htm
  2. #2
  3. Hello World :)
    Devshed Frequenter (2500 - 2999 posts)

    Join Date
    Mar 2003
    Location
    Hull, UK
    Posts
    2,537
    Rep Power
    69
    Just a few questions , what version of Python do you have running on your system. You seem to have 2.1 on your web server.. also, by pyxml you meam the built-in xml modules or the addon xml modules?

    Your error is pretty hard to read (silly Apache ), but I'd say that the sax parser your using in your program isnt being found . My best sugestion would be to upgrade your Python version or to pick another parser such as dom if it's available?

    oh I ran your CGI script from my brower (http://hepfm000.uta.edu/mcp.htm) no error? have you already fixed it?

    Anyway hope this helped..

    Take care,
    Mark.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    2
    Rep Power
    0
    a) I have not fixed the bug... just modified it so I can show my professor something is running

    b) dom is too memory expensive for parsing the data collected

    c) i need to try and upgrade my webserver python and see how it goes..

    will let u know about it...thanxx again

    -prashant
  6. #4
  7. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Sep 2003
    Posts
    1
    Rep Power
    0

    How to get around the NoParsersFound error


    If upgrading Python on the host to fully support xml.sax is difficult, you can use the following pure Python module:

    XMLFilter

    Whenever there's no xml.sax parser, it falls back to the older xmllib, and adapts it to look just like xml.sax. It's been tested all the way back to Python 1.5.2.

IMN logo majestic logo threadwatch logo seochat tools logo