I’m trying to use xml2py (for the first time) in ctypes v
I’ve generated what appears to be a valid xml file from a c header file.
Next, I attempt to run xml2py and get a python keyerror exception from the gccxmlparser.py module.
Does this error suggest that my xml file needs an attribute “size” that doesn’t exist?
Can anyone offer any suggestions?
Thanks in advance,
Here’s the traceback information:
C:\>python xml2py.py nivision.xml -o nivision.py
Traceback (most recent call last):
  File "xml2py.py", line 173, in ?
  File "xml2py.py", line 169, in main
  File "C:\Python24\Lib\site-packages\ctypes\wrap\codegenerator.py", line 791, in generate_code
    items = parse(xmlfile)
  File "C:\Python24\Lib\site-packages\ctypes\wrap\gccxmlparser.py", line 382, in parse
    xml.sax.parse(xmlfile, handler)
  File "C:\Python24\lib\xml\sax\__init__.py", line 33, in parse
  File "c:\python24\lib\xml\sax\expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "C:\Python24\lib\xml\sax\xmlreader.py", line 123, in parse
  File "c:\python24\lib\xml\sax\expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "c:\python24\lib\xml\sax\expatreader.py", line 300, in start_element
    self._cont_handler.startElement(name, AttributesImpl(attrs))
  File "C:\Python24\Lib\site-packages\ctypes\wrap\gccxmlparser.py", line 43, in startElement
    result = mth(attrs)
  File "C:\Python24\Lib\site-packages\ctypes\wrap\gccxmlparser.py", line 236, in Enumeration
    size = attrs["size"]
  File "C:\Python24\lib\xml\sax\xmlreader.py", line 316, in __getitem__
    return self._attrs[name]
KeyError: 'size'

Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1˘/min.