From: Christian Kaiser
Sent: Tuesday, April 23, 2013 6:19 AM

> 
> Hello generators,
> 
> my name is Christian and I'm from Germany.
> 
> Since last week i have a project to convert XML files into
> a self created python object. Generateds was very helpful
> and I'm nearly done with my project but I've a schema file
> which always runs into Errors.

Christian -

Good to hear from you.  Glad to hear that generateDS.py has been
helpful.  Sorry about the error.  But, I believe that there is an
easy fix.  See below.

> The problem is it's the only
> official schema file in the project and I really can't get
> where the error is located.
> So maybe someone is pleased to help me a bit.
> 
> Here are the informations.
> 
> I'm using Python 2.7.3 and the 2.9a of generateDS on ubuntu 12.10

I'm using Python 2.7.3 and Ubuntu 12.10, also.

> 
> i try the command 'generateDS.py --silence -o 'outfile.py' 'mpeg7v2.xsd'     
> and get the following Error
> 
> Traceback (most recent call last):

[snip]

>   File "/usr/local/lib/python2.7/dist-packages/_xmlplus/sax/expatreader.py", 
>line 312, in start_element
>     self._cont_handler.startElement(name, AttributesImpl(attrs))
>   File 
>"/usr/local/lib/python2.7/dist-packages/generateDS-2.9a-py2.7.egg/EGG-INFO/scripts/generateDS.py",
> line 1561, in startElement
>     'memberTypes' in attrs):
>   File "/usr/local/lib/python2.7/dist-packages/_xmlplus/sax/xmlreader.py", 
>line 316, in __getitem__
>     return self._attrs[name]
> KeyError: 0
> 
> 
> Thank You for your time.
> 
> Cheers,
> 

I was not able to reproduce this error.  I've tried on two of my
machines.

I believe that the occurance of "_xmlplus" in your traceback is a
clue.  Is it possible that there is an old library that is left over
from the use of PyXML?  The XML SAX support is now in the standard
Python library and distribution.  I do not have _xmlplus directory
in my Python installation.  I believe that it is no longer needed.
Here is a suggestion.

Try renaming the _xmlplus directory under 
/usr/local/lib/python2.7/dist-packages/
so as to hide it.  Then run generateDS.py again. Does that make
things better?  You most likely do not need that _xmlplus directory
at all, unless there is some legacy code, perhaps, that requires it.

Also, you should have installed lxml in order to use run generateDS.py.
(See: http://lxml.de/.)  when generateDS.py runs, it should be using
lxml (as well as the SAX support in the standard library).  When the
code *generated* by generateDS.py runs, either lxml or the code in the
Python standard library is fine.

Please let me know if this fixes your problem.  I've had a similar
issue reported once before.  So, I'd like to know if this is really
the way to deal with it.

Thanks again for letting me know about this.

- Dave
  


--


Dave Kuhlman
http://www.rexx.com/~dkuhlman

------------------------------------------------------------------------------
Try New Relic Now & We'll Send You this Cool Shirt
New Relic is the only SaaS-based application performance monitoring service 
that delivers powerful full stack analytics. Optimize and monitor your
browser, app, & servers with just a few lines of code. Try New Relic
and get this awesome Nerd Life shirt! http://p.sf.net/sfu/newrelic_d2d_apr
_______________________________________________
generateds-users mailing list
generateds-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/generateds-users

Reply via email to