gnosis XML objectify

Discussion in 'Python' started by Wang, Harry, Nov 26, 2007.

  1. Wang, Harry

    Wang, Harry Guest

    The gnosis xml libs should not be version specific, but when I try to use Python 2.5, I am getting "not well formed (invalid token)" errors.

    Harry
    Wang, Harry, Nov 26, 2007
    #1
    1. Advertising

  2. Wang, Harry

    Guest

    On Nov 26, 1:46 pm, "Wang, Harry" <> wrote:
    > The gnosis xml libs should not be version specific, but when I try to use Python 2.5, I am getting "not well formed (invalid token)" errors.
    >
    > Harry


    When does this happen? When you import the module? When you pass it
    some xml? Do you have a full traceback?

    Mike
    , Nov 26, 2007
    #2
    1. Advertising

  3. On Nov 26, 8:46 pm, "Wang, Harry" <> wrote:
    > The gnosis xml libs should not be version specific, but when I try to use Python 2.5, I am getting "not well formed (invalid token)" errors.
    >
    > Harry


    Could you show us a simple example that exhibits this behavior
    please ?

    SB
    Sébastien Boisgérault, Nov 26, 2007
    #3
  4. Wang, Harry

    Wang, Harry Guest

    Full Traceback enclosed:

    Test Suite Started @ 2007-11-26 11:34:46.617000
    Traceback (most recent call last):
    File "C:\UDR2\UDRxmlGateway.py", line 370, in <module>
    ParseAll()
    File "C:\UDR2\UDRxmlGateway.py", line 286, in ParseAll
    py_obj = gnosis.xml.objectify.XML_Objectify(InputFile).make_instance()
    File "C:\python25\Lib\site-packages\gnosis\xml\objectify\_objectify.py", line 160, in make_instance
    o = self.ParseFile(self._fh)
    File "C:\python25\Lib\site-packages\gnosis\xml\objectify\_objectify.py", line 190, in ParseFile
    self._myparser.ParseFile(file)
    xml.parsers.expat.ExpatError: not well-formed (invalid token): line 68, column 0

    Harry C. Wang
    Sr. Test Engineer (Automation)
    AOL Mobile
    Phone 206 - 268 - 7502
    temporary e-mail:
    Personal e-mail:

    ________________________________

    From: python-list-bounces+hwang= on behalf of
    Sent: Mon 11/26/2007 12:19 PM
    To:
    Subject: Re: gnosis XML objectify



    On Nov 26, 1:46 pm, "Wang, Harry" <> wrote:
    > The gnosis xml libs should not be version specific, but when I try to use Python 2.5, I am getting "not well formed (invalid token)" errors.
    >
    > Harry


    When does this happen? When you import the module? When you pass it
    some xml? Do you have a full traceback?

    Mike
    --
    http://mail.python.org/mailman/listinfo/python-list
    Wang, Harry, Nov 26, 2007
    #4
  5. Wang, Harry

    Wang, Harry Guest

    I can't tell where in the XML file it throws the error.

    Here is the snippet of the Python code:
    def ParseAll():
    py_obj = gnosis.xml.objectify.XML_Objectify(InputFile).make_instance()

    Harry C. Wang
    Sr. Test Engineer (Automation)
    AOL Mobile
    Phone 206 - 268 - 7502
    temporary e-mail:
    Personal e-mail:

    ________________________________

    From: python-list-bounces+hwang= on behalf of Sébastien Boisgérault
    Sent: Mon 11/26/2007 12:21 PM
    To:
    Subject: Re: gnosis XML objectify



    On Nov 26, 8:46 pm, "Wang, Harry" <> wrote:
    > The gnosis xml libs should not be version specific, but when I try to use Python 2.5, I am getting "not well formed (invalid token)" errors.
    >
    > Harry


    Could you show us a simple example that exhibits this behavior
    please ?

    SB
    --
    http://mail.python.org/mailman/listinfo/python-list
    Wang, Harry, Nov 26, 2007
    #5
  6. Wang, Harry

    Guest

    On Nov 26, 2:33 pm, "Wang, Harry" <> wrote:
    > Full Traceback enclosed:
    >
    > Test Suite Started @ 2007-11-26 11:34:46.617000
    > Traceback (most recent call last):
    > File "C:\UDR2\UDRxmlGateway.py", line 370, in <module>
    > ParseAll()
    > File "C:\UDR2\UDRxmlGateway.py", line 286, in ParseAll
    > py_obj = gnosis.xml.objectify.XML_Objectify(InputFile).make_instance()
    > File "C:\python25\Lib\site-packages\gnosis\xml\objectify\_objectify.py", line 160, in make_instance
    > o = self.ParseFile(self._fh)
    > File "C:\python25\Lib\site-packages\gnosis\xml\objectify\_objectify.py", line 190, in ParseFile
    > self._myparser.ParseFile(file)
    > xml.parsers.expat.ExpatError: not well-formed (invalid token): line 68, column 0
    >
    > Harry C. Wang
    > Sr. Test Engineer (Automation)
    > AOL Mobile
    > Phone 206 - 268 - 7502
    > temporary e-mail:
    > Personal e-mail:
    >
    > ________________________________
    >
    > From: python-list-bounces+hwang= on behalf of
    > Sent: Mon 11/26/2007 12:19 PM
    > To:
    > Subject: Re: gnosis XML objectify
    >
    > On Nov 26, 1:46 pm, "Wang, Harry" <> wrote:
    >
    > > The gnosis xml libs should not be version specific, but when I try to use Python 2.5, I am getting "not well formed (invalid token)" errors.

    >
    > > Harry

    >
    > When does this happen? When you import the module? When you pass it
    > some xml? Do you have a full traceback?
    >
    > Mike
    > --http://mail.python.org/mailman/listinfo/python-list


    Googling the error seems to indicate that the problem may be an
    encoding issue. Check the following threads:

    http://www.mail-archive.com//msg00787.html
    http://article.gmane.org/gmane.comp.python.devel/90093
    http://mail.python.org/pipermail/python-list/2007-July/450288.html

    Mike
    , Nov 26, 2007
    #6
  7. Wang, Harry wrote:
    > Test Suite Started @ 2007-11-26 11:34:46.617000
    > Traceback (most recent call last):
    > File "C:\UDR2\UDRxmlGateway.py", line 370, in <module>
    > ParseAll()
    > File "C:\UDR2\UDRxmlGateway.py", line 286, in ParseAll
    > py_obj = gnosis.xml.objectify.XML_Objectify(InputFile).make_instance()
    > File "C:\python25\Lib\site-packages\gnosis\xml\objectify\_objectify.py", line 160, in make_instance
    > o = self.ParseFile(self._fh)
    > File "C:\python25\Lib\site-packages\gnosis\xml\objectify\_objectify.py", line 190, in ParseFile
    > self._myparser.ParseFile(file)
    > xml.parsers.expat.ExpatError: not well-formed (invalid token): line 68, column 0


    You XML input is broken. This is not a gnosis problem.

    Look at line 68 in your XML file.

    Stefan
    Stefan Behnel, Nov 27, 2007
    #7
    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. David Mertz

    What's new with Gnosis

    David Mertz, Jul 12, 2003, in forum: Python
    Replies:
    3
    Views:
    326
    Bruno Desthuilliers
    Jul 13, 2003
  2. David Mertz, Ph.D.

    [Announce] Gnosis Utils 1.1.0 (update)

    David Mertz, Ph.D., Jul 16, 2003, in forum: Python
    Replies:
    0
    Views:
    315
    David Mertz, Ph.D.
    Jul 16, 2003
  3. David Mertz, Ph.D.

    Article on updates to gnosis.xml.objectify

    David Mertz, Ph.D., Dec 4, 2004, in forum: Python
    Replies:
    0
    Views:
    280
    David Mertz, Ph.D.
    Dec 4, 2004
  4. johnny

    newb: lxml objectify

    johnny, Mar 30, 2007, in forum: Python
    Replies:
    0
    Views:
    260
    johnny
    Mar 30, 2007
  5. Wang, Harry

    gnosis XML objectify

    Wang, Harry, Nov 26, 2007, in forum: Python
    Replies:
    0
    Views:
    266
    Wang, Harry
    Nov 26, 2007
Loading...

Share This Page